Package Exports
- react-hmr
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-hmr) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-hmr
The AMD wrapper of react-hot-loader@next for react HMR
How to use
Install
npm install react-hmr --save-devUsage
DEV ENV
Preload
dist/react-hot-loader.dev.jsordist/react-hot-loader.dev.min.jscompress versionUpdate your React app entry code:
- import/require
patchandAppContaineras the React.Component proxy, thepatchshould execute before the app startup - use the
AppContainercomponent wrap your app root component
import patch from 'react-hot-loader/patch'; import AppContainer from 'react-hot-loader/lib/AppContainer'; import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; const store = { name: 'react' }; ReactDOM.render( <AppContainer> <App></App> </AppContainer>, document.getElementById('app') );
- import/require
PROD ENV
Like
DEV ENV, except for preloaddist/react-hot-loader.prod.jsordist/react-hot-loader.prod.min.jscompress version.
Reference
- react-hot-loader: the next version
- The next react-hot-loader upgrade example