Skip to content
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

44 lines (32 sloc) 869 Bytes

CSS Modules with React


import React from 'react'
import CSSModules from 'react-css-modules'
/* import your css modules styles for the component */
import styles from './Demo.css' 

function Demo( props) {

    const { route } = props

    return (
    	<div styleName='demo'>
    		<button styleName='button blue'>press me</button>

export default CSSModules(Demo, styles, {allowMultiple: true} )


import React from 'react'
import ReactDOM from 'react-dom'
import Demo from './components/Demo'

function App(props) {
    return (
            <Demo />

ReactDOM.render(React.createElement(App), document.getElementById('root'))
You can’t perform that action at this time.