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

usage with simple files (local) or rollup / better public api docs #1225

Open jeremy-coleman opened 5 years ago

jeremy-coleman commented 5 years ago

is it possible to provide some simple documentation on how to request a reload and the fields for the information it needs? what are the public exports? is there already a function i can call to reload? does it attach a listener on window? does it expect a uri, code string, or module name?

theKashey commented 5 years ago

The only thing React-Hot-Loader is doing - hot-reloading React components. It does not provide any infrastructure for module hot reloading, just uses the one provided by a bundle of your choice.

The only "public" API for this - https://github.com/gaearon/react-hot-loader/blob/master/src/reactHotLoader.js#L36 - reactHotLoader.register, to "replace" one component by another. Everything else - is out of our scope.