Is trere a suggested way to render part of a children component in an ancestor (like the Portal but in component tree)?
I mean to send the node there by a Context or provide the Ref throught props or transport that by callbacks up? Is there a way to use real Portal?
I prefer functional components please.
const Children = () => <>
<Primary/>
<ToAncestor><Secondary/></ToAncestor>
<>
const Parent = () => <Children/>
const Ancestor = () => <>
<Parent/>
<SecondaryContentFromChildren/> <-- the magic
<>
Thank you ❤️