Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Media Query crashing app #574

Closed
shilpan opened this issue Feb 4, 2016 · 1 comment
Closed

Media Query crashing app #574

shilpan opened this issue Feb 4, 2016 · 1 comment

Comments

@shilpan
Copy link

shilpan commented Feb 4, 2016

My code is as follows:

import React, { Component } from 'react';
import Radium from 'radium';

const styles = {
    'base': {
        '@media (min-width: 320px)': {
            marginLeft: 700
        },
        'marginTop': 100,
        'marginLeft': 500,
    },
    'test': {
        'color': '#123423',
        ':hover': {
          backgroundColor: 'red'
        }
    }
};

class App extends Component {
    render() {
        return (
            <div>
                <p style={[
                        styles.base,
                        styles.test
                    ]}>hi</p>
            </div>
        );
    }
}

export default Radium({isRoot: true})(App);
@ianobermiller
Copy link
Contributor

I assume you are referring to this error?

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

You need to wrap your app in <StyleRoot>. See the docs at https://github.com/FormidableLabs/radium/tree/master/docs/api#styleroot-component.

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

No branches or pull requests

2 participants