-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[fixed] server side rendering for Modal component #719
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
Conversation
Using document reference in the render method will throw an error on React.renderToString call on the server side. See #717. The proper solution is to remove document.querySelector check. Obviously we cant detect this feature on the server side, besides it leads to differencies btw server and client side rendering output, so React will warn about it, ex: 1. `render` on the server side will apply classes: `modal fade` 2. `render` on the client side will apply clasess: `modal fade in` Also karma test environment is not suitable for testing server side rendering, so mocha test run againt nodejs was added.
I'm banging my head against the wall trying to figure out why I like the idea of testing the components for Server side rendering, though I wonder if there is a way to survey which of the current tests should work in both and then do so with both. Though this can be done later as proposed in #720. LGTM Need an additional review by one of the @react-bootstrap/collaborators |
👍 |
[fixed] server side rendering for Modal component
It looks like it was due to how Looks like the idea was to use |
All seemed to work without it, but I only checked in Chrome. @taion Are you concerned with this being removed? It's not clear from your last comment. |
I am not. FadeMixin no longer works like that. Just commenting on why that errant check was there in the first place. |
Good to know thanks! |
* docs: update readme with correct org name * fix
Using document reference in the render method will throw an error
on React.renderToString call on the server side.
See #717.
The proper solution is to remove document.querySelector check. Obviously
we cant detect this feature on the server side, besides it leads to
differencies btw server and client side rendering output, so React will warn
about it, ex:
render
on the server side will apply classes:modal fade
render
on the client side will apply clasess:modal fade in
Also karma test environment is not suitable for testing server side rendering,
so mocha test run againt nodejs was added.