react prop and expressions Flashcards
1
Q
What are props in React?
A
properties
2
Q
How do you pass props to a component?
A
return <h1>Hello, {props.name}</h1>;
3
Q
How do you write JavaScript expressions in JSX?
A
To write a JavaScript expression within JSX you will have to surround the JavaScript code in { } brackets