Created
April 1, 2020 08:24
-
-
Save nandorojo/f9d9a6ab34c4989c33a2e3df208eba1d to your computer and use it in GitHub Desktop.
AuthGate example
This file contains hidden or 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 React from 'react' | |
import { useAuthGate } from 'react-native-doorman' | |
class LoadingScreen extends React.Component { | |
componentDidMount() { | |
const { loading, user } = this.props | |
// ...navigate here | |
} | |
render() { | |
// your render code here | |
} | |
} | |
export default function WithHook(props) { | |
const { loading, user } = useAuthGate() | |
return <LoadingScreen loading={loading} user={user} /> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment