question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error in ./~/react-toolbox/lib/button/theme.css

See original GitHub issue

Hi, getting error when add react-tool component. Module build failed: Error: composition is only allowed when selector is single :local class name not in ".raised", ".raised" is weird we have not web-pack config file then how i fix this issue ? similar issues

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
javivelascocommented, Feb 2, 2017

@umair-khanzada React Toolbox current version relies on CSS Modules to handle styling. If you require a component from react-toolbox, the css will be required for you but the configuration should enable modules. This is not the case for create-react-app: you are requiring a css file that has assumes that modules are enabled and that’s why you get the warning.

To avoid it (and to skip configuration with any other project and react toolbox) you can use the recently released react-toolbox-themr. It allows you to extract and transform CSS from react-toolbox to be required as any other css asset. Beware you should require components always default from its definition, for example from react-toolbox/lib/button/Button instead of the named export of the index.js. You should do it this way because we are currently exposing components with and without styles. This is going to change soon as a style refactoring is in progress.

Let me know any other issues in the react-css-themr repository!

2reactions
javivelascocommented, Jun 14, 2017

Yeah it is possible but you have need to eject and configure CSS Modules as detailed in React Toolbox documentation or in the Webpack example repository. I think that was a too opinionated decision and I’m working on changing the approach to deliver fully flexible components. I encourage you to use themr meanwhile, the only downside is dependency resolution because the CSS should be manually included.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: composition is only allowed when selector is single ...
react -toolbox/lib/button/theme.css Module build failed: Error: composition is only allowed when selector is single :local class name not in ...
Read more >
React-Toolbox Theme error - Stack Overflow
From react-toolbox documentation. React Toolbox uses CSS Modules by default to import stylesheets written using PostCSS/cssnext features.
Read more >
react-toolbox/react-toolbox - Gitter
Hey guys, is there a precompiled css file available so I don't clutter my webpack config only for adding react-toolbox lib?
Read more >
alexi2/react-toolbox - npm
A set of React components implementing Google's Material Design specification with the power of CSS Modules.. Latest version: 1.0.2, ...
Read more >
composition is only allowed when selector is single
react -toolbox/lib/button/theme.css. Module build failed: Error: composition is only allowed when selector is single :local class name not in ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found