diff --git a/components/Redirect.tsx b/components/Redirect.tsx index fe27fe3..c82b38d 100644 --- a/components/Redirect.tsx +++ b/components/Redirect.tsx @@ -1,3 +1,4 @@ +import { ReactNode } from 'react' import dynamic from 'next/dynamic' import { useRouter } from 'next/router' @@ -5,10 +6,13 @@ import { redirectTo } from '@utils/Tools' const Container = dynamic(() => import('@components/Container')) -const Redirect = ({ to }:RedirectProps):JSX.Element => { +const Redirect = ({ to, children }:RedirectProps):JSX.Element => { const router = useRouter() if(!to) throw new Error('No Link') redirectTo(router, to) + if(children) return <> + {children} + return
자동으로 리다이렉트되지 않는다면 클릭해세요. @@ -18,6 +22,7 @@ const Redirect = ({ to }:RedirectProps):JSX.Element => { interface RedirectProps { to: string + children?: ReactNode } export default Redirect \ No newline at end of file