-
Notifications
You must be signed in to change notification settings - Fork 231
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
no window on serve side #48
Comments
Oh nasty. I think this is some leftover stuff from before we used browserify. Should be safe to remove. Want to send a PR? |
Hi, I've run into the same issue. I've added a pull request #55 to address it. It was not safe to just remove the check though, because the generated dist file will be unable to find window.React, I've added a transform to the build script which fixes that issue. This restores the old behavior, there are probably more complete solutions, but this one seems to work for now. |
Do you know if this was broken for both webpack and browserify? Or just the later? |
Browserify & webpack will just work they do not need the window.React test. The examples broke because they rely on window.React. In short:
|
K, this is merged. Do you need a 1.0.3 release for this? Or is this mainly for source distributions? |
Thanks, it does need a new release. Projects depending on react-typeahead will then have serverside rendering fixed. |
@rhalff - got it. I cut a 1.0.3 release just now with just this change. Thanks for contributing! |
For example
https://github.com/fmoo/react-typeahead/blob/master/src/typeahead/index.js#L5
creates a dependency to
window
prevents server side rendering as is (unless working around it by declaring it as {}).The text was updated successfully, but these errors were encountered: