Your subtree should be able to travel into another top-level tree.
<Travel
onMount={node => {
return(
$(node).dialog({
autoOpen: false,
close: () => {
this.setState({dialogOpen: false})
}
}).data('ui-dialog')
)
}}
onUpdate={dialog => {
if(dialogOpen) {
dialog.open()
} else {
dialog.close()
}
}}
>
<div>
Even works with third party dialogs!
</div>
</Travel>
What node the portal is rendered to, defaults to document.body
.
What tag to use for the portal, defaults to div
.
React id prop.
React className prop.
React style prop. Accepts an object of styles that are applied to the portal. Note that values require their respective unit applied i.e style={{padding: '12px'}}
.
Accepts a single React element or component.
All tie into React's life cycle methods. Returns portal node with any work done to it.