I’m just about to attempt to figure out how to use React Portals (Cf createPortal) in a Helix project. I haven’t found any mention of it in the Helix repo. If anybody has any pointers (say, to documentation), it would be appreciated.
UPDATE: It turns out to be straightforward. createPortal
(required from "react-dom"
) is simply used as a child in the declaration of a Helix component, eg:
(defnc my-component []
(<>
(d/p "The following text will be mounted in the body element:")
(createPortal (d/p "This text is a child of the body element.")
(.. js/document -body))))