Open gijo-varghese opened 5 years ago
For now what I've done is:
import habitat from "preact-habitat";
import Root from "./Root";
window.render = () => {
habitat(Root).render({
...
});
};
// in development, set up HMR:
if (module.hot) {
require("preact/devtools"); // enables React DevTools, be careful on IE
module.hot.accept("./Root", () => requestAnimationFrame(init)); // eslint-disable-line
}
window.render();
So later in my React components, I can use window.render()
@zouhir can you pls take a look when you're free?
I'm using the widget inside a modal and several other components in a react project. So when the render function executes it could not find the widgets since it's still not added to the dom.
Can I call render function again? If so how is it? Is it the right method?