Hacker News new | ask | show | jobs
by Kiro 1116 days ago
Then how do I emulate onMount now?
1 comments

You have to use a useRef then inside your useEffect of [] you check if it is false and it it is you set it to true then run your code.

If anyone reads this and I am wrong please comment, but from what I can see that's the only solution.