Created
August 31, 2022 19:13
-
-
Save danieljpgo/af5628d48463a2f534bbe144d84cfbd5 to your computer and use it in GitHub Desktop.
Render Prop example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useAuth } from '~/hooks'; | |
type AuthProps = { | |
children: ({ auth }: { auth: ReturnType<typeof useAuth> }) => JSX.Element; | |
}; | |
export default function Auth(props: AuthProps) { | |
const auth = useAuth(); | |
return props.children({ auth }); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment