Open imcuttle opened 5 years ago
I never had use case where this is useful, but, when a developer explicitly calls render() I think we should do it. I will have this in mind, thanks.
I will add force
option.
This bug means that you cannot use preact-habitat on the same selector more than once
for example if someone is using this library for 2 widgets on their site (usually widgets will use the body selector), only the first one will work
Edit: turns out it doesn't matter anyway because preact renders a tree only once for each root container, i needed to do this:
// preact will render only once for each container
const container = document.createElement('div')
document.body.appendChild(container)
render(<App />, container)
The code rejected rerender from outside by calling
render
https://github.com/zouhir/preact-habitat/blob/69699493715f002ccf37ac85d5af342628b50a37/src/lib.js#L123-L125