react-function-components Flashcards

1
Q

What is a React component?

A

they are like JS functions; they accept arbitrary inputs (called “props”) and return React elements describing what should appear on screen

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

write a JS function or use ES6 class to define component; components must start with capital letters

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

use ReactDOM.render(element,document.querySelector(“#root”))

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