2

what is the best way to load css on server side rendering with React-Redux (Universal App)

Note: server side performance is priority.

For Ex: Isomorphic-style-loader or react-style or Any other.

Nithish
  • 369
  • 1
  • 8
  • 20
  • Show us what you've tried. – Adam Barnes Jan 30 '18 at 09:46
  • You can also have a look at [webpack-plugin-critical](https://www.npmjs.com/package/webpack-plugin-critical), you can search for "inline critical path css" for additional resources. – Gabriel Bleu Jan 30 '18 at 11:00
  • I have implemented isomorphic-style-loader. is there any production issues with this? (present am in development state). – Nithish Jan 31 '18 at 14:25
  • How did you implement isomorphic-style-loader, I have issues with it. Would you mind sharing some tips? – Develoger Feb 11 '18 at 16:44
  • in server side file: const context = { insertCss: (...styles) => { //console.log('executing'); return styles.forEach(function(style) {css.add(style._getCss())}) } }; contextprovider.js class ContextProvider extends React.Component { getChildContext() { return { ...this.props.context }} render () {const { children, ...props } = this.props return React.cloneElement(children, props); }}ContextProvider.childContextTypes = { insertCss: PropTypes.func,} – Nithish Feb 12 '18 at 09:14

0 Answers0