Skip to content

Instantly share code, notes, and snippets.

@khtdr
Created August 17, 2015 18:55
Show Gist options
  • Save khtdr/bd99c772548203a0f540 to your computer and use it in GitHub Desktop.
Save khtdr/bd99c772548203a0f540 to your computer and use it in GitHub Desktop.
adding stylesheet to components.js
import React, { PropTypes } from 'react';
// this is defined in src/client/app.js
if (window.__CLIENT__) {
require('./components.css');
}
export default class Counter {
//...
}
@khtdr
Copy link
Author

khtdr commented Aug 17, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment