advanced-react-patterns
advanced-react-patterns copied to clipboard
Changelog
Here's what's going to be different in the next version of the advanced-react-patterns workshop (you can find all these changes in the next branch until the videos are re-recorded):
- Everything is TypeScript. There's a new script you can run to remove the TypeScript automatically if you want:
./scripts/remove-ts. - General improvements to the workshop content based on feedback from learners
- Completely removed exercise 1 (Context Module Functions). It's an extremely niche pattern that even I haven't actually found useful in any of my projects.
- Completely removed exercise 2 (Compound Components w/ React.cloneElement). There's really no great reason to not just use context which we teach in exercise 3.
- Add a new exercise 1 titled: "Latest Ref". This is a simple pattern that I find myself using regularly.
- Add a new exercise 2 titled: "Composition and Layout Components". This is another simple pattern I find myself using regularly.
- Add a new exercise 5 titled: "State Initializer". This is a pattern I used to have in the workshop then removed and now it's back again because I had enough people who were surprised when they saw it hiding there in the other exercises. It allows users to reset your component/hook's state to the initial value.
- In exercise 6 (state reducer) I removed extra credit 2 about action types since we're using typescript now and action types are no longer needed. On a related note we also no longer don't need the
defaultcase for our reducer switch statement because we're using typescript. - In exercise 7 (control props) I drastically simplified the extra credits by making a single
useControlPropWarningshook and providing that for folks to just import. Now it's just one extra credit. It really should just be an open source library people can use. It's not very complicated, but it's hard to come up with on your own and doesn't really add much to your learning. A lot of people had trouble with this one and I think this change will improve it quite a bit.
Conversation locked to avoid conversation about any of these points. These are more notes than anything else. If you want to discuss any of these, open another issue.