diff --git a/example/src/credo/CredoScreen.tsx b/example/src/credo/CredoScreen.tsx index ef3c01f..502de83 100644 --- a/example/src/credo/CredoScreen.tsx +++ b/example/src/credo/CredoScreen.tsx @@ -3,7 +3,7 @@ import AgentProvider from '@credo-ts/react-hooks' import CredentialProvider from '@credo-ts/react-hooks/build/CredentialProvider' import ProofProvider from '@credo-ts/react-hooks/build/ProofProvider' import * as React from 'react' -import { type ReactElement, useEffect, useState } from 'react' +import { useState } from 'react' import { Button, Text } from 'react-native' import { Spacer } from '../Spacer' import { Prover } from './Prover' @@ -16,33 +16,41 @@ export const CredoScreen = () => { const [role, setRole] = useState<'prover' | 'verifier'>() const [agent, setAgent] = useState() - useEffect(() => { - setupAgent().then(setAgent) - }, []) - - let component: ReactElement - if (!role) { - component = ( + return ( <> -