-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
html-jsx fix case-insensitive attributes and style names #838
Comments
In React, we currently warn in Otherwise, I agree that we should make some improvements to the HTML-JSX converter for accuracy. The tool is meant to still be in beta :) cc @Daniel15 |
Thanks, I can work on this. It might be worth utilising DefaultDOMPropertyConfig.js in html-jsx-lib so that its checks are consistent with React itself. I'm actually surprised how well the HTML to JSX converter is working at the moment, it seems like the only issues are little ones that should have easy fixes.
|
Moving HTMLToJSX issues to the https://github.com/reactjs/react-magic repository. |
Solution
-Known attributes like maxlength have to be camelcased to maxLength or whatever is in [DefaultDOMPropertyConfig] https://github.com/facebook/react/blob/master/src/dom/DefaultDOMPropertyConfig.js
Might be a good idea to throw a warning/error for unknown properties, so they don't get discarded without you knowing.
-Styles should be lowercased before processing.
Example
transpiles to:
transpiles to:
generates:
The text was updated successfully, but these errors were encountered: