Error in ./~/react-toolbox/lib/button/theme.css
See original GitHub issueHi,
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:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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 forcreate-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 fromreact-toolbox/lib/button/Button
instead of the named export of theindex.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!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.