babel-plugin-react-css-modules
babel-plugin-react-css-modules copied to clipboard
Unknown prop `styleName` on <div> tag.
Using version 2.6.1. I am getting this warning while testing the components.
Is this "the same" issue as https://github.com/gajus/react-css-modules/issues/147?
Also, I seem to be able to reproduce this with 3.0.0.
@tlycken I was able to work around that issue in react-css-modules (it was something on my end causing the issue). However, switching from react-css-modules to this library, I'm greeted with this issue again.
I just started to use ignore-styles library while testing components but that is not a good fix.
@Igor-Vuk you might have to specify in your .babelrc file...
{
"env": {
"test": {
"plugins": [
["react-css-modules", {
"context": <same_context_as_your_webpack_config_context>
}]
]
}
}
}
I tried to configure it the same way as is configured in my webpack, it didn't work.
"env": {
"test": {
"presets": [
"react",
"es2015",
"stage-0"
],
"plugins":[
[ "babel-plugin-webpack-alias", { "config": "./webpack.config.js" } ],
[ "babel-plugin-react-css-modules", {"context": "./src/client", "filetypes": {".scss": "postcss-scss"}}]
]
}
}
I'm wondering if context gets resolved to a relative path under the hood or if it's expected that we pass in the resolved path.
Digging through here, it doesn't look like it resolves an absolute path for the context you pass in.
How should I write it then for it to work?