Skip to main content
Module

x/alephjs/framework/react/mod.ts>usePortal

The Full-stack Framework in Deno.
Latest
function usePortal
import { usePortal } from "https://deno.land/x/alephjs@1.0.0-alpha.78.1/framework/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; preventScroll?: boolean; }

Returns

(el: ReactNode) => ReactPortal | null