Socket
Socket
Sign inDemoInstall

react-transform-hmr

Package Overview
Dependencies
7
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-transform-hmr

A React Transform that enables hot reloading React classes using Hot Module Replacement API


Version published
Weekly downloads
135K
decreased by-7.83%
Maintainers
1
Install size
1.61 MB
Created
Weekly downloads
 

Readme

Source

react-transform-hmr

A React Transform that enables hot reloading React classes using Hot Module Replacement API.

Hot module replacement is supported natively by Webpack and available in Browserify with browserify-hmr.

Installation

First, install the Babel plugin:

npm install --save-dev babel-plugin-react-transform

Then, install the transform:

npm install --save-dev react-transform-hmr

Then edit your .babelrc to include extra.babel-plugin-react-transform.
It must be an array of the transforms you want to use:

{
  "stage": 0,
  "plugins": [
    "react-transform"
  ],
  "extra": {
    // must be defined and be an array
    "react-transform": [{
      "target": "react-transform-hmr",
      // if you use React Native, pass "react-native" instead:
      "imports": ["react"],
      // this is important for Webpack HMR:
      "locals": ["module"]
    }]
    // note: you can put more transforms into array
    // this is just one of them!
  }
}

Finally, make sure you process files with babel-loader, and that you don’t use React Hot Loader (it’s not needed with this transform).

This transform has no effect when process.env.NODE_ENV is set to 'production'.

License

MIT

Keywords

FAQs

Last updated on 19 Sep 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc