Skip to content
Discussion options

You must be logged in to vote

Yes. The usual pattern is to give React its own DOM node that Miso never diffs into, and mount the React tree there yourself. Miso has the hooks for exactly this (“third-party widget initialisation” in the onCreated docs).

  1. A tiny JS bundle that exposes mount/unmount (built with Vite/esbuild together with React + h5web):
import { createRoot } from "react-dom/client";
import { App, H5GroveProvider } from "@h5web/app";

const roots = new WeakMap();
window.mountH5Web = (el, props) => {
  const root = createRoot(el);
  roots.set(el, root);
  root.render(
    <H5GroveProvider url={props.url} filepath={props.filepath}>
      <App />
    </H5GroveProvider>
  );
};
window.unmountH5Web = (el) => r…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dmjio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants