Closed wtobi closed 12 months ago
When the app is mounted in strict mode (https://beta.reactjs.org/reference/react/StrictMode), loading stored guesses doesn't work. At least not with development builds.
This is a quick and easy fix for that.
A better way to fix that might be to restructure the useEffect
s somehow. But I'm no React expert, so don't know how or if that'd really help.
Anyway, what happens is that saveGuesses
is called with an empty gridData
array because of StrictMode's double rendering (I think).
Sorry for not following your commit message guidelines. I couldn't check out the project on this machine and had to use GitHub's online editor.
Check for empty gridData to prevent overwriting stored guesses in React.StrictMode