import { FocusScope } from '@react-aria/focus'; import { useEffect, useRef } from 'react'; type FocusBoundaryProps = { children: React.ReactNode; }; const FocusBoundary = ({ children }: FocusBoundaryProps) => { const wrapperReference = useRef(null); useEffect(() => { wrapperReference.current?.focus({ preventScroll: true }); }, []); return (
{children}
); }; export default FocusBoundary;