React issue
why the products is logged 4 times not 2 ?
![](https://utfs.io/f/64294be8-1810-4861-855e-66ee28050fe7-1nq2cb.png)
![](https://utfs.io/f/5ded916b-aedc-4767-b1e6-c26515c61e15-1nq2cb.png)
4 Replies
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•17mo ago
Message Not Public
Sign In & Join Server To View
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•17mo ago
Message Not Public
Sign In & Join Server To View