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
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
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