Created
May 21, 2020 13:39
-
-
Save louisrli/3ab3f898d8c96a095415cce90cb964c9 to your computer and use it in GitHub Desktop.
Props and State: Teach each other
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# React Props and State | |
## Learning Goal | |
At the end of this activity, you should understand what props and state are and know how to use them. How? You'll teach each other! | |
You'll be in pairs. | |
* **Person 1:** Responsible for props | |
* **Person 2:** Responsible for state | |
## Requirements | |
### Person 1: Props | |
Create a component (your choice in making whatever you want) that has two required props and one optional prop. The optional prop should be optional because it has a default value. | |
* Use this component at least three times, once with the default prop unset | |
### Person 2: State | |
Create a component (your choice in making whatever you want) that has three state variables that are set to initial values. | |
Make an element which, on click, somehow modifies one of the state variables. | |
**Bonus:** Pass a state variable as a prop to another child component. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment