-
Notifications
You must be signed in to change notification settings - Fork 115
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
Server side render warning #13
Comments
Yep @StefanoPastore, if you need server-side rendering I'd say your solution works pretty well. I think all you'd need from us in that case is a Would you like to make a PR? |
@mjackson of course. I made it, I met two problems: to test the feature I implemented Please see the commit messages for the change log. Thanks. |
See #15 |
Hi,
I set up my app with server-side rendering.
But I got this warning in the browser:
This is because react-media deletes some element from the DOM in the client-side according to media queries, but in the server-side rendering all elements are rendered because
matches
prop is true by default.This approach causes different DOM elements to be rendered in the client and the server.
So, how to fix this warning?
I was thinking about the solution and I found this solution.
For example I have this code:
Result:
My solution Result is:
I think that this is a correct way to do match server-side rendering with client-side rendering at the first time and it's possible to remove this approach for others rendering in the client-side only.
What do you think?
Thanks.
The text was updated successfully, but these errors were encountered: