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