-
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
Avoid adding ';' in inlined styles when unnecessary #9353
Comments
What's the problem exactly? |
When I minify HTML rendered with React, last Removing the last |
That's not how reconciliation works at the moment, it computes a hash which the client checks. HOWEVER the error message will highlight the semicolon as the possible culprit because it doesn't know for sure what the server generated and tries to make a best guess. If that is how it worked you wouldn't be allowed to run the minifier over the code at all, because any change would trip React. Tl;dr; the semicolon is not actually the problem. |
So removing the last |
This was fixed in #9550 🎉 |
Do you want to request a feature or report a bug?
Sounds like a feature but this is causing problem when server side generated HTML payload are pass through html-minifier.
What is the current behavior?
As stated in the serialization function: https://github.com/facebook/react/blob/master/src/renderers/dom/shared/CSSPropertyOperations.js#L172, all properties are ended with a
;
.If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/84v837e9/).
N/A
What is the expected behavior?
All properties should be ended with a
;
except the last one.Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
N/A
Referenced issue: ssrwpo/ssr#45
The text was updated successfully, but these errors were encountered: