Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Jul 13, 2014
2 parents b1bee1a + 89dd270 commit 7e8dab2
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,6 @@ It marries React with Webpack [Hot Module Replacement](http://webpack.github.io/

Inspired by [react-proxy-loader](https://github.com/webpack/react-proxy-loader).

### Running Example

```
npm install
cd example
webpack-dev-server --hot
open http://localhost:8080/webpack-dev-server/bundle
```

Then edit `example/a.jsx` and `example/b.jsx`.
Your changes should be displayed live, without unmounting components or destroying their state.

### Implementation Notes

Currently, it keeps a list of mounted instances and updates their prototypes when an update comes in.
A better approach may be to make monkeypatch `createClass` to return a proxy object [as suggested by Pete Hunt](https://github.com/webpack/webpack/issues/341#issuecomment-48372300):

>The problem is that references to component descriptors could be stored in any number of places. What we could do is wrap all components in "proxy" components which look up the "real" component in some mapping

## Installation

`npm install react-hot-loader`
Expand All @@ -51,6 +31,25 @@ You can also specify loader in config before `jsx-loader`:

This will enable hot reload for all JSX files.

## Running Example

```
npm install
cd example
webpack-dev-server --hot
open http://localhost:8080/webpack-dev-server/bundle
```

Then edit `example/a.jsx` and `example/b.jsx`.
Your changes should be displayed live, without unmounting components or destroying their state.

## Implementation Notes

Currently, it keeps a list of mounted instances and updates their prototypes when an update comes in.
A better approach may be to make monkeypatch `createClass` to return a proxy object [as suggested by Pete Hunt](https://github.com/webpack/webpack/issues/341#issuecomment-48372300):

>The problem is that references to component descriptors could be stored in any number of places. What we could do is wrap all components in "proxy" components which look up the "real" component in some mapping
# License

MIT (http://www.opensource.org/licenses/mit-license.php)

0 comments on commit 7e8dab2

Please sign in to comment.