Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
useKeydownHandler(event => {
if (onKeyDown && stackIndex === 0) {
onKeyDown(event);
}
});
const dialogTitleId = useMemo(generateUEID, []);
if (!attachTo) {
return null;
}
return createPortal(
{isOpen ? (
) : null}
render() {
const { attachTo, children, component, width, transitionState } = this.props;
if (!attachTo) {
return null;
}
return createPortal(
<dialog width="{width}">
{children}
</dialog>
,
attachTo
);
}
}
{transitionState => (
{content}
)}
heading,
initialFocus,
onClose,
width,
transitionState,
} = this.props;
const dialogTitleId = generateUEID();
if (!attachTo) {
return null;
}
return createPortal(
<dialog aria-labelledby="{dialogTitleId}">
{heading} Dialog
{heading ? (
<header>
<title>{heading}</title>
</header></dialog>