React-starter-kit: Where do I load a CSS framework?

Created on 12 Mar 2016  路  1Comment  路  Source: kriasoft/react-starter-kit

I am attempting to load Semantic UI into the starter pack, and at the moment I am including it on all pages in the old fashion way. Where should I be loading my .css and .js files?

Most helpful comment

@alexdrans try to configure a loader for these files, then import them from your top-level React component, for example:

import withStyles from 'isomorphic-style-loader/lib/withStyles';
import s from '../../../node_modules/module-name/file.css';

class Layout extends React.Component { ... }

export default withStyles(Layout, s);

Alternatively, you can specify the list of loaders along with their settings on the same line where you reference a CSS file, for example:

import s from '!!isomorphic-style-loader!css-loader!../../../node_modules/module-name/file.css';

>All comments

@alexdrans try to configure a loader for these files, then import them from your top-level React component, for example:

import withStyles from 'isomorphic-style-loader/lib/withStyles';
import s from '../../../node_modules/module-name/file.css';

class Layout extends React.Component { ... }

export default withStyles(Layout, s);

Alternatively, you can specify the list of loaders along with their settings on the same line where you reference a CSS file, for example:

import s from '!!isomorphic-style-loader!css-loader!../../../node_modules/module-name/file.css';
Was this page helpful?
0 / 5 - 0 ratings