-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReferenceError: document is not defined #42
Comments
Hey, sorry I just noticed this issue. I see you're using nextjs. Are you using the This is the only place react-tetris/src/modules/detect-shift.ts Lines 7 to 22 in 52ca9e3
|
Any idea on how to fix this issue? I am trying to run this on an expo native react project, thought at first it might be a problem with the dom-manipulation as I'm running this with expo go in my iPhone. |
@ImranSefat want to file a separate issue about supporting react native? It seems like in that environment, you wouldn't want any keyboard handling, ticks would be handled with |
Environment:
I am trying to conditionally render component when the user wants to play a game
const [playTetris, setPlayTetris] = useState(false);
and conditional render
{ playTetris && <Tetris />) }
At the dev environment - doesn't make any problem.
While Building:
Probably, the Tetris component trying to access the window.document before ComponentDidMount?
The text was updated successfully, but these errors were encountered: