-
-
Save khtdr/bd99c772548203a0f540 to your computer and use it in GitHub Desktop.
adding stylesheet to components.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { PropTypes } from 'react'; | |
// this is defined in src/client/app.js | |
if (window.__CLIENT__) { | |
require('./components.css'); | |
} | |
export default class Counter { | |
//... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't particularly like this solution, I would rather have zero checks for
__CLIENT__
or__SERVER__
in the shared directory. I think it makes the example app less clear. But it gets the job done.