In todays exercise we are going to practice lifecycles for a functional and class component.
✨ Requirements ✨
- When you click the button the class should toggle from 'default' to 'active
- So if a button is 'default' and is clicked it should now have an 'active' className and vice versa
✨ Requirements ✨
- The like count displays the number of likes each student / teacher has.
- The starting like count should be a random number and is set when the component first mounts.
- When the button is clicked the like count should go up. The count should be set and stored in state.
- When clicked the button should have a class of "active" that after 500ms will be reset to "default"
- Meet all the same requirements as step 02 but now using a functional component.
Please (only) work on the file src/student.js
.
You can open this repository in Codesandbox by going to the following link where you add your Github username at the end: https://codesandbox.io/s/github/redi-react-fall-2020/06-exercises-lifecycle-methods-YOUR_GITHUB_USERNAME
If you opened this repo in code-sandbox, you can see in the app what is working and what not.
You can also open the console in Codesandbox to see the output of your functions.