Skip to content

Instantly share code, notes, and snippets.

@danieljpgo
Created August 31, 2022 19:13
Show Gist options
  • Save danieljpgo/af5628d48463a2f534bbe144d84cfbd5 to your computer and use it in GitHub Desktop.
Save danieljpgo/af5628d48463a2f534bbe144d84cfbd5 to your computer and use it in GitHub Desktop.
Render Prop example
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