Skip to content
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

Unknown prop styleName on <div> tag. #82

Open
Igor-Vuk opened this issue May 4, 2017 · 9 comments
Open

Unknown prop styleName on <div> tag. #82

Igor-Vuk opened this issue May 4, 2017 · 9 comments

Comments

@Igor-Vuk
Copy link

Igor-Vuk commented May 4, 2017

Using version 2.6.1. I am getting this warning while testing the components.

@tomasaschan
Copy link

Is this "the same" issue as https://github.com/gajus/react-css-modules/issues/147?

@tomasaschan
Copy link

Also, I seem to be able to reproduce this with 3.0.0.

@besh
Copy link

besh commented Jul 6, 2017

@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.

@Igor-Vuk
Copy link
Author

Igor-Vuk commented Jul 6, 2017

I just started to use ignore-styles library while testing components but that is not a good fix.

@besh
Copy link

besh commented Jul 6, 2017

@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>
         }]
      ]       
    }
  }
}

@Igor-Vuk
Copy link
Author

Igor-Vuk commented Jul 6, 2017

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"}}]
      ]
    }
  }

@besh
Copy link

besh commented Jul 6, 2017

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.

@besh
Copy link

besh commented Jul 6, 2017

Digging through here, it doesn't look like it resolves an absolute path for the context you pass in.

@Igor-Vuk
Copy link
Author

Igor-Vuk commented Jul 6, 2017

How should I write it then for it to work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants