Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/aleph/runtime/react/mod.ts>usePortal

The Full-stack Framework in Deno.
Go to Latest
function usePortal
import { usePortal } from "https://deno.land/x/aleph@1.0.0-beta.23/runtime/react/mod.ts";

The usePortal hook to create a portal helper. Please ensure to pass the React.createPortal in Router props.

function Modal() {
  const portal = usePortal({ preventScroll: true });
  return portal(<p>Hello portal!</p>);
}

Parameters

optional
props: { key?: string | null; className?: string; lockScroll?: boolean; isDialog?: boolean; }

Returns

(children: ReactNode) => ReactPortal | null