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

Function AuthWrapper

example/withSuspense/Auth.tsx:15–27  ·  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 { data: signInCheckResult } = useSigninCheck();
17
18 if (!children) {
19 throw new Error('Children must be provided');
20 }
21
22 if (signInCheckResult.signedIn === true) {
23 return children as JSX.Element;
24 } else {
25 return fallback;
26 }
27};
28
29const UserDetails = () => {
30 const auth = useAuth();

Callers

nothing calls this directly

Calls 1

useSigninCheckFunction · 0.85

Tested by

no test coverage detected