mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
24 lines
717 B
Markdown
24 lines
717 B
Markdown
# Step 2.4 - React Context (Exercise)
|
|
|
|
[Lessons](../) | [Exercise](./exercise/) | [Demo](./demo/)
|
|
|
|
If you don't already have the app running, start it by running `npm start` from the root of the `frontend-bootcamp` folder. Click the "exercise" link under day 2 step 4 to see results.
|
|
|
|
## TodoContext.Provider Component
|
|
|
|
1. Open `exercise/src/components/TodoApp.tsx`
|
|
|
|
2. Uncomment the missing functions inside the value prop
|
|
|
|
## TodoFooter, Context inside Functional Component
|
|
|
|
1. Open `exercise/src/components/TodoFooter.tsx`
|
|
|
|
2. Replace the two constants by using useContext(TodoContext)
|
|
|
|
## TodoHeader, Context inside Class Component
|
|
|
|
1. Open `exercise/src/components/TodoHeader.tsx`
|
|
|
|
2. Replace the couple of TODO
|