function components Flashcards

1
Q

What is a React component?

A

components are like JavaScript functions that accept inputs called props or properties, and returns a react element describing what should appear. Allows to reuse components easier

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

How do you define a function component in React?

A
by writing a JavaScript function that returns a react element;
function name has to start with capital letter
any function that returns jsx
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you mount a component to the DOM?

A

be using the root.render method and passing the component as an argument

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