React-Props-and-Expressions Flashcards
1
Q
What are props in React?
A
props are a type of object where the value of attributes of a tag is stored. you can also pass any JavaScript value through them, including objects, arrays, and functions.
2
Q
How do you use props in a component?
A
You can pass them to child components, specify default values
3
Q
How do you pass props to a component?
A
you can pass props by listing them in your components parameters so that you can then use them later inside your component body
4
Q
How do you write JavaScript expressions in JSX?
A
By wrapping the expression inside curly braces