Uncaught Error: To use plugins requiring `addCSS` (e.g. keyframes, media queries), please wrap your application in the StyleRoot component. Component name: in react JS

Uncaught Error: To use plugins requiring `addCSS` (e.g. keyframes, media queries), please wrap your application in the StyleRoot component. Component name:

This error come when you have not added Style root Component and you are using media queries or keyframes , animation.

const yog = (props) => {
    const style = {
        '@media(min-width: 500px)':{
                width:'450px'
        }
    }
........

Then import the style root Component from radium.

import Radium, { StyleRoot } from 'radium';
....

put whole app component in styleroot

render() {
return (
 <StyleRoot>
 
</StyleRoot>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s