Skip to content
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

fix(package): do not access window/document in ssr #806

Merged
merged 7 commits into from
Nov 10, 2016

Conversation

levithomason
Copy link
Member

@levithomason levithomason commented Nov 7, 2016

Fixes #712

In server side rendering, there is not a valid document nor window. Accessing them will throw.

This PR adds an isBrowser util. It then prevents calls to the document and window in components if there is no browser present.


P.S.

We might want to consider a browser shim for this in the future instead. I can see it providing smarter access to the document and window. It could also handle things like event pooling, #284.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant