-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Can't use styleName
props with css modules + react.
#1320
Comments
The issue is the normalization of the html to xhtml that is done via post-html. Uppercase attributes are not valid even though they get parsed because the SVG standard allows them. If you change styleName to style-name it should be working for react at least this works in vue. Maybe we could make some PRs to post-html to allow uppercase attributes though. Since it even lowers them for html5 with specified doctype config |
@kawamurakazushi react-css-modules is a babel plugin... nothing to do with ts. |
@Hammster probably a good idea, but jsx doesn't get processed by post-html so this is a different issue. As you have a babel config why let typescript transform the jsx code? |
Oh didnt know that but least it is a valid explaination for #1123 |
Has this solution fixed your issue @kawamurakazushi ? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. |
🐛 bug report
Hi, I'm creating a simple app using typescript + react + css modules.
And the styleName is not compiling in the right way.
Please refer to the code sample below.
🎛 Configuration (.babelrc, package.json, cli command)
.babelrc
.postcssrc
tsconfig.json
package.json
🤔 Expected Behavior
Compile
😯 Current Behavior
Whenever I run parcel styleName just compiles to stylename.
When I try using
className
instead ofstyleName
it works like a charm using the following solution discussed in this issue.#616
💁 Possible Solution
🔦 Context
💻 Code Sample
src/index.html
src/index.tsx
src/App.tsx
🌍 Your Environment
The text was updated successfully, but these errors were encountered: