gaearon / react-hot-loader

Tweak React components in real time. (Deprecated: use Fast Refresh instead.)
http://gaearon.github.io/react-hot-loader/
MIT License
12.26k stars 801 forks source link

codemod to upgrade to 4.5.0+ #1176

Open sibelius opened 5 years ago

sibelius commented 5 years ago

does it make sense a codemod to migrate all hot(module) usage to only hot?

this code:

import { hot } from 'react-hot-loader'
const App = () => <div>Hello World!</div>
export default hot(module)(App)

will be transformed into this one:

import { hot } from 'react-hot-loader/root'
const App = () => <div>Hello World!</div>
export default hot(App)
sibelius commented 5 years ago

I've made it here https://github.com/sibelius/react-hot-loader-codemod

let me know if you want to bring this code to this repo or add this to readme

theKashey commented 5 years ago

That's awesome, and worth to be mentioned in a readme.