import { createCallbackLogFormatter } from '@fluentui/code-sandbox'; import { useBooleanKnob, useLogKnob } from '@fluentui/docs-components'; import { Button, Header, Portal } from '@fluentui/react-northstar'; import * as React from 'react'; const PortalExampleOpen = () => { const [open, setOpen] = useBooleanKnob({ name: 'open' }); const onClick = useLogKnob('onClick()', () => setOpen(!open), createCallbackLogFormatter([])); return ( <> This is a controlled portal Portals have tons of great callback functions to hook into. To close, simply click the close button > ); }; export default PortalExampleOpen;
Portals have tons of great callback functions to hook into.
To close, simply click the close button