remix-livereload
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

Remix LiveReload

Same as Remix's LiveReload, but it exposes a handle to listen to HMR updates. Useful if you need to do some work after HMR updates, like reloading i18n translations.

Usage

Same as you would use Remix's LiveReload, but you can pass a callback using the onHMR prop. In your root file:

import { LiveReload } from "remix-livereload";

export default function App() {
	const handleHMR = useCallback((hmrEvent) => {
		console.log(hmrEvent);
	}, []);

	return (
		<html>
			<head></head>
			<body>
				<LiveReload onHMR={handleHMR} />
			</body>
		</html>
	);
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

Readme

Keywords

Package Sidebar

Install

npm i remix-livereload

Weekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

7.94 kB

Total Files

7

Last publish

Collaborators

  • tgds-at-npm