Skip to content

Commit

Permalink
Merge pull request #34 from johangirod/patch-1
Browse files Browse the repository at this point in the history
Adding hot reload section in the README
  • Loading branch information
koistya committed Apr 14, 2016
2 parents b033833 + 4ad5330 commit c7af229
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Expand Up @@ -85,7 +85,7 @@ const server = express();
const port = process.env.PORT || 3000;

// Server-side rendering of the React app
server.get('*', (req, res, next) =>
server.get('*', (req, res, next) =>
const css = []; // CSS for all rendered React components
const context = { insertCss: (styles) => css.push(styles._getCss()) };
router.dispatch({ ...req, context }).then((component, state) => {
Expand Down Expand Up @@ -114,11 +114,11 @@ It should generate an HTML output similar to this one:
```html
<html>
<head>
<title>My Application</title>
<title>My Application</title>
<script async src="/client.js"></script>
<style type="text/css">
.MyComponent_root_Hi8 { padding: 10px; }
.MyComponent_title_e9Q { color: red; }
.MyComponent_title_e9Q { color: red; }
</style>
</head>
<body>
Expand All @@ -138,6 +138,9 @@ requested web page, effectively dealing with [FOUC](https://en.wikipedia.org/wik
issue and improving client-side performance. CSS of the unmounted components
will be removed from the DOM.

##### Hot reload
You can activate hot module reload for style by setting the `debug` option to true in your webpack configuration. If you are using webpack 2, you need to supply it though the `LoaderOptionsPlugin` because the [`debug` option has been removed](https://gist.github.com/sokra/27b24881210b56bbaff7#loader-options--minimize)

### Backers

♥ Isomorphic Style Loader? Help us keep it alive by [donating funds](https://www.patreon.com/tarkus) to cover project expenses!
Expand Down

0 comments on commit c7af229

Please sign in to comment.