Career Choice React Cheatsheet

View the Project on GitHub davegregg/react-cheatsheet

Creating a component

Passing a value to a component (props)

Insert a value into JSX

Handling state in a class component

Handling events

Test section

I want to create a component.


If I want a component to be *static,* and I don't anything changed inside of it later:

  • I will write it as a **functional component**. Functional components only take inputs (props) and provide their output to the DOM.

If I want a component to be *smart* or if it needs to be interactive:

  • Then write it as a **class component**.