brandly / brandly/react-tetris

ReferenceError: document is not defined

Open
#42 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
140
Forks
70
PR merge metrics
No merged PRs in 30d

Description

Environment:

- [x] nextjs
- [x] node: v21.5.0
- [x] react: 18+

I am trying to conditionally render component when the user wants to play a game
`const [playTetris, setPlayTetris] = useState(false);`
and conditional render
`{ playTetris && ) }`

At the dev environment - doesn't make any problem.

While Building:

> ReferenceError: document is not defined

Probably, the Tetris component trying to access the window.document before **ComponentDidMount**?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.