react-props-and-expressions Flashcards

1
Q

What are props in React?

A

An object that is passed to a component which has property value pairs associated with the attribute value pairs meant for the React elements within the component.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you pass props to a component?

A

When a component is defined in a React element, after the tag name attribute value pairs can be defined. Those will automatically be passed to that component in the form of the props object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you write JavaScript expressions in JSX?

A

With curly braces. If used to set attribute values for components, don’t wrap in quotes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly