react-function-components-Q&A Flashcards
1
Q
What is a React component?
A
independent and reusable bits of code.
2
Q
How do you define a function component in React?
A
function Name(props) { return jsx; }
3
Q
How do you mount a component to the DOM?
A
const container = document.querySelector('#root'); const root = ReactDOM.createRoot(container); root.render();