-
Notifications
You must be signed in to change notification settings - Fork 47.5k
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
React renders differently on server and client. #4616
Comments
This is likely a red herring, the warning here didn't do the best job of detecting differnces like this, but we've improved it on master. Can you try with the latest betas and see if it still repros? |
Or rather, it would still report that something is different, but it should point you at the actual difference and not a random encoded entity (see other discussion in #4608) |
Posted this in my issue as well: It turns out that Chrome now has |
That's weird, I would expect both to use the enumeration order. |
I have traced it down to |
Yeah, that should just use this for/in loop: https://github.com/facebook/react/blob/master/src/shared/stubs/Object.assign.js#L37. |
If I switch out the |
Good sleuthing. |
I'm facing to this issue. Any news on it? My server generate: |
@Spy-Seth your issue is unrelated. Make sure you have charset as utf-8 and if that doesn't resolve it please work it out elsewhere or file an issue if you can pinpoint a bug in React |
My page is already interpreted in utf8 |
@zpao could this be caused on server side by server not having locales generated for |
@Spy-Seth if you read the rest of the issue, I said the entity piece was probably a red herring and then the original reporter never responded. The rest of the discussion is about ordering of attributes (with some other discussion in #4608). If your issue is actually about encoding, then please file a new issue with a complete example to reproduce. It's otherwise impossible to help. |
Our issue turned out to be an issue with the
|
Is this issue about mismtach caused by character encoding (@vlinder) or attribute ordering changed by object.assign (@mridgway)? I am seeing a similar issue as @mridgway that in some cases the props key ordering is changed by object.assign and then by using the spread operator to specify them causes the server the client to render the attributes in different order. Since the spec doesn't specify the ordering the keys in an object, it seems pretty fragile that we take the attribute ordering into account when determining if there is a mismatch. The other way is to have the spread operator returns a consistent ordering, but not sure how you can do that except doing a sort on the keys, which is pretty costly. |
@ktslwy For me it was always character encoding. As my original message pointed out. Did not have any time to create a minimal test case though. And I haven't been seeing this error in a while. So prabably a newer version has corrected the problem. |
Ah!! That sounds like a really good reason for me seeing this warning:
I have an isomorphic app so I can't see a reason key ordering should be different.... except for what you are saying here. Thanks! |
@Download same thing here with React 15.0.2.. This is the diff: https://www.diffchecker.com/zvlfqz5n. |
Can anyone seeing wrong attribute orders re-install and make sure you have [email protected]? That should fix the issue. |
@spicyj that works for me. Thanks. |
Thanks @spicyj I uninstalled React 15.0.1 and I installed React 15.0.2 and this seems to have fixed it. |
I'll close since the fix has been out for a while, and we also don't care about the prop order in 16. |
I have read #3152 and #3879 but this seemed like maybe another but related problem.
When the browser tries to bootstrap React and rerender the page I get this warning.
Apart from the case that it is unnecessary to escape the quote it seems to render differently on the server and browser. This is just static content so I don't really understand why?
The markup to render the element is like this.
How come it's rendered different?
The text was updated successfully, but these errors were encountered: