gajus / babel-plugin-react-css-modules

Transforms styleName to className using compile time CSS module resolution.
Other
2.05k stars 162 forks source link

styleName not working when className === component name? #251

Closed iblq closed 5 years ago

iblq commented 5 years ago

code like this:

const Home = () => {
    return <div styleName="home">home</div>;
};

any one have same problem?

gajus commented 5 years ago

Define not working?

What is the generated className.

Closing this until further details provided.

iblq commented 5 years ago

o, sorry, detail: like my code, when the styleName is 'home' or 'Home', the component's name is 'Home' also, style not work 120F5B50FB4B7A7FE2AAF3533A4E2F74

gajus commented 5 years ago

What is this rendered to?

The way to debug it is to check what is the resulting className when the page is loaded and if that class name is exported by the CSS module.

iblq commented 5 years ago

What is this rendered to?

The way to debug it is to check what is the resulting className when the page is loaded and if that class name is exported by the CSS module.

emmmm... that's strang, my mate and me get this bug this morning, but now it's work well, maybe some webpack config or package version has problem. thx for your reply