react-function-components Flashcards
1
Q
What is a React component?
A
Conceptually, components are like JavaScript functions. They accept arbitrary inputs (props) and return React elements describing what should appear on the screen.
2
Q
How do you define a function component in React?
A
function name(props) {
return (React element)
}
3
Q
How do you mount a component to the DOM?
A
Call the render method of the root object to mount your React element to the DOM