Effects in depth
Write correct effects, and avoid effects that should not exist.
- RCT.04.01Effects synchronise with external systemsCoreMid-level11 min
- RCT.04.02You might not need an effectCoreMid-level10 min
- RCT.04.03Stale closures, dependencies and effect eventsCoreMid-level11 min
- RCT.04.04Fetching in effects correctlyCoreMid-level11 min
Interview questions in this module
- What is a stale closure in React? Show an example and fix it.
- When does the effect cleanup function run?
- Give examples of effects you should remove.
- How do you prevent race conditions when fetching data in an effect?
- What is
useEffectEventfor? - Why is
useEffectwith an empty array not the same ascomponentDidMount?