Skip to content

Instantly share code, notes, and snippets.

@nandorojo
Created April 1, 2020 08:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nandorojo/f9d9a6ab34c4989c33a2e3df208eba1d to your computer and use it in GitHub Desktop.
Save nandorojo/f9d9a6ab34c4989c33a2e3df208eba1d to your computer and use it in GitHub Desktop.
AuthGate example
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