rhr
react-hot-reload.macro
npm i react-hot-reload.macro
Deprecated!
This does NOTTHING, but just remove the wrapper on process.env.NODE_ENV === 'production'. I recommend to use react-hot-loader-loader by @NoamELB
rhr

react-hot-reload.macro

Zero configuration 🔥Hot Module Replacement🔥 using Babel macro

by Hyeseong Kim

2.1.2 (see all)License:MITTypeScript:Built-In
npm i react-hot-reload.macro
Readme

react-hot-reload.macro

Babel Macro NPM

Zero configuration 🔥Hot Module Replacement🔥 using Babel macro and react-hot-loader, mostly for Create React App (v2+) users

No eject 🎉 No configuration 🎉

Usage

yarn add react-hot-reload.macro
# or
npm install --save react-hot-reload.macro

Modify your App.js component

import React from 'react'
+import hot from 'react-hot-reload.macro'

...

-export default App
+export default hot(App)

That's it. Happy Hacking!

React-🔥-DOM

RHL will patch React, replace React-DOM by React-🔥-DOM and work with fiber directly

Since RHL 4.5.0+, you would need to patch react-dom by @hot-loader/react-dom

Currently only available option without ejecting is using Yarn's name resolution.

yarn add react-dom@npm:@hot-loader/react-dom

(if anyone know another workaround of it, please let me know)

Configure RHL

You still can use RHL's APIs. Following the setConfig() API of RHL.

Changelog

  • v2.1.2

    • Add Flow type definition
    • Update babel-plugin-macros to ^2.5.1
    • Update react-hot-loader to ^4.8.2
  • v2.1.0

    • Update babel-plugin-macros to ^2.5.0
    • Update react-hot-loader to ^4.7.0
  • v2.0.2

    • Add TypeScript definition

Downloads/wk

16

GitHub Stars

31

LAST COMMIT

2yrs ago

MAINTAINERS

1

CONTRIBUTORS

0

OPEN ISSUES

2

OPEN PRs

1
VersionTagPublished
2.1.2
latest
3yrs ago
No alternatives found
No tutorials found
Add a tutorial