MCPcopy Index your code
hub / github.com/FirebaseExtended/reactfire / AuthWrapper

Function AuthWrapper

example/withoutSuspense/Auth.tsx:15–28  ·  view source on GitHub ↗
({ children, fallback }: React.PropsWithChildren<{ fallback: JSX.Element }>)

Source from the content-addressed store, hash-verified

13}
14
15export const AuthWrapper = ({ children, fallback }: React.PropsWithChildren<{ fallback: JSX.Element }>): JSX.Element => {
16 const { status, data: signInCheckResult } = useSigninCheck();
17
18 if (!children) {
19 throw new Error('Children must be provided');
20 }
21 if (status === 'loading') {
22 return <LoadingSpinner />;
23 } else if (signInCheckResult.signedIn === true) {
24 return children as JSX.Element;
25 }
26
27 return fallback;
28};
29
30const UserDetails = ({ user }) => {
31 const auth = useAuth();

Callers

nothing calls this directly

Calls 1

useSigninCheckFunction · 0.85

Tested by

no test coverage detected