What about window variables used in common business codes?

  node.js, question

In the client browser, it can run normally, but when the component is initialized, the global variables already photographed on the page will be used. For this part of the code, an error will be reported at the node server, and the reference to the global variables is very deep.
How to deal with this situation?

Decoupling through props. In this way, components can also be reused.
The props value is the window variable by default.