paypal / react-engine

a composite render engine for universal (isomorphic) express apps to render both plain react views and react-router views
Apache License 2.0
1.45k stars 130 forks source link

FR: Support CSS modules. #167

Closed hemanth closed 8 years ago

hemanth commented 8 years ago

Something as simple as:

import Styles from './Hello.css'
class Header extends React.Component {
    constructor(props) {
        super(props);
        this.displayName = 'Header';
    }
    render() {
         return <div className={Styles.header}>HEADER</div>;
    }
}

Fails to render the bundle that is generated with webapck and isomorphic-style-loader the rendering is done on the server side.

grawk commented 8 years ago

Hi @hemanth. Would you mind opening this issue against anemone-machina?

hemanth commented 8 years ago

Done anemone-machina#2

samsel commented 8 years ago

@hemanth isn't this outside the scope of react-engine? what does the error say?

hemanth commented 8 years ago

Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. Check the render method ofLayout.

isomorphic-style-loader needs the context, which can't be set if we are using react-engine or do you suggest to do that in Kraken server itself?

grawk commented 8 years ago

Let's discuss here: https://github.com/krakenjs/anemone-machina/issues/2