JSPM

react-hmr

0.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q34184F
  • License MIT

The react hot loader for hmr wrapping react-hot-loader

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

Dependency Status devDependency Status NPM Version

The AMD wrapper of react-hot-loader@next for react HMR

How to use

Install

npm install react-hmr --save-dev

Usage

  • DEV ENV

    1. Preload dist/react-hot-loader.dev.js or dist/react-hot-loader.dev.min.js compress version

    2. Update your React app entry code:

      • import/require patch and AppContainer as the React.Component proxy, the patch should execute before the app startup
      • use the AppContainer component 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')
      );
  • PROD ENV

    Like DEV ENV, except for preload dist/react-hot-loader.prod.js or dist/react-hot-loader.prod.min.js compress version.

Reference