Learning Fuze > react-function-components > Flashcards
What is a React component?
reusable piece of UI that is created using JavaScript and the React JavaScript library. It can accept inputs (props) and return a tree of elements (virtual DOM) that describe how the component should render.
How do you define a function component in React?
const ExampleComponent = (props) => {
return (
<div>
<h1>Hello {props.name}!</h1>
</div>
);
};
export default ExampleComponent;
How do you mount a component to the DOM?
ReactDOM.render