chetannada / Namaste-React

❤ Namaste React Live Course from Zero to Hero 🚀 by Akshay Saini(Founder of NamasteDev). This repository for Assignment & Class Notes taken during Namaste React Live Course #namaste #javascript #react
https://foodfire-app.netlify.app/
1.91k stars 1.01k forks source link

Changes in statement #1

Closed danishagarwal closed 1 year ago

danishagarwal commented 1 year ago

Line 40 - If we do not pass empty dependency array then the useEffect hook only runs when the UI is rendered for the first time.

But if we do not pass empty dependency array then useEffect is called "Each time UI is rendered" and not only once. If the dependency array is "empty" then useEffect is called only once.

chetannada commented 1 year ago

Thanks danishagarwal for the contribution.