Closed chrisgloom closed 5 months ago
hmm, attaching it to the window and calling the function in the console just does the move once as expected. These are some react shenanigans it seems. But I'm still confused, if my react code is being called twice, I'd expect to see any console log twice and I only get it once.
Ah. Probably my react noob showing through, since it touches the DOM it needs to be done inside of useEffect otherwise react will do react things and rerender it I guess. Still not sure why I don't see two console logs but it's working now and I don't care enough to find out ;)
Glad to hear you figured it out!
Steps to reproduce the issue
sorry for the messy code had commented out a lot to challenge my assumptions.
Using experimentalAddMove in a react component in a nextjs project, the move happens twice for some reason, F is F2, R is R2...not sure why. Open to it being entirely my fault haha. Maybe something to do with it being in a react component?
Observed behaviour
The intended move is applied twice to the cube
🖼 Screenshots
Expected behaviour
Just applied once
Environment
nextjs blog project
Additional info
No response