https://github.com/afeiship/react-hmr-decorator
React hot module reload decorator.
https://github.com/afeiship/react-hmr-decorator
decorator hmr hot react
Last synced: 3 months ago
JSON representation
React hot module reload decorator.
- Host: GitHub
- URL: https://github.com/afeiship/react-hmr-decorator
- Owner: afeiship
- License: mit
- Created: 2018-07-05T04:32:52.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-03-06T04:32:28.000Z (over 4 years ago)
- Last Synced: 2025-06-06T17:43:06.717Z (4 months ago)
- Topics: decorator, hmr, hot, react
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# react-hmr-decorator
> React hot module reload decorator## installation
```bash
npm install @jswork/react-hmr-decorator
```## usage
1. index.js
```js
import React from 'react';
import ReactDOM from 'react-dom';
import App from './app';ReactDOM.render(
,
document.getElementById('root')
);
```2. app.js
```js
import React from 'react';
import hotable from 'react-hmr-decorator';@hotable(module)
export default class extends React.Component{
render(){
return (
Hello world _42323!
)
}
}
```3. babelrc
```json
{
"presets":[
"env",
"react"
],
"plugins": [
"react-hot-loader/babel",
"transform-decorators-legacy"
]
}
```4. package.json scripts:
```json
"scripts": {
"dev": "webpack-dev-server --hot"
},
```## resources
- https://github.com/gaearon/react-hot-loader
- https://github.com/afeiship/webpack-notes
- https://larrylu.blog/react-decorator-hoc-2536db2737cb