React issue

why the products is logged 4 times not 2 ?
4 Replies
Chris Bolson
Chris Bolson2y ago
I believe that useEffect, when using React.StrictMode, is actually called twice. So if you are expecting 2 console logs that may explain why you are actually getting 4. I am new to React so I may be completely wrong. To extend my answer, as I understand it, when using the default StrictMode React is running all the hooks twice. This only happens in dev.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Chris Bolson
Chris Bolson2y ago
Svelte looks amazing. I want to get a bit better at React first (as it is more commonly requested) before getting into Svelte. I can't wait!
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server