mthanh2209 / react-training

https://react-training-eight.vercel.app
0 stars 0 forks source link

Implement removing effect dependencies #161 #185

Closed mthanh2209 closed 9 months ago

mthanh2209 commented 9 months ago
  1. How to fix infinite Effect dependency loops
    • Check the dependencies you have provided.
    • Ensure that no dependency changes trigger the re-execution of the effect, causing an infinite loop.
  2. How to read a value from your Effect without “reacting” to it
    • To read a value from useEffect without causing a re-render, you can use an external intermediate variable
    • Use useRef to store the value without triggering the re-execution of the effect.
  3. Why suppressing the dependency linter is dangerous, and what to do instead
    • Disabling the dependency linter can reduce code quality by eliminating crucial warnings.
    • The dependency linter helps you identify potential issues in your code.
    • Instead, clearly identify necessary dependencies and ensure they are maintained accurately to prevent unintended errors.
vercel[bot] commented 9 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
react-training ❌ Failed (Inspect) Jan 25, 2024 4:06am
storybook ❌ Failed (Inspect) Jan 25, 2024 4:06am