using parcel with preact:
when i edit a js file, hot module reloading appends the newly rendered html instead of replacing it.
how can i avoid that?
thx
That's part of preact. See the note on render
: https://preactjs.com/guide/differences-to-react#what-s-different-
To avoid, you can add a third argument to render like this:
const node = document.body;
render(<SomeApp />, node, node.lastChild);
@hobbes7878 thank you for the heads up and the link. very helpful.
parcel is out here, closing it.
I found this answer after a single Google search. this makes me happy.
Most helpful comment
That's part of preact. See the note on
render
: https://preactjs.com/guide/differences-to-react#what-s-different-To avoid, you can add a third argument to render like this: