Open CurryYangxx opened 2 months ago
hi, looking at the looking you sent, the console.log is not inside a useEffect, but rather inside the component, so it will run every time the component re-renders. Have you modified this since you wrote the issue?
hi, looking at the looking you sent, the console.log is not inside a useEffect, but rather inside the component, so it will run every time the component re-renders. Have you modified this since you wrote the issue?
@alexnm Hello, I am refering to the console.log in the Component.txs. The console.log(obj)
is in useEffect, and I think it should only run once.
🐛 bug report
Preflight Checklist
Description of the problem
The useEffect sometimes running twice
How has this issue affected you? What are you trying to accomplish?
To Reproduce
refresh the browser in sandbox several times, and you can see the
console.log()
run twiceLink to sandbox: [link]() (optional)
https://codesandbox.io/p/devbox/black-hooks-znysly?file=%2Fsrc%2FApp.tsx%3A9%2C30
Your Environment