Demo Authentication app in React Native
This is a demo app to study and demonstrate the proper implementation of an authentication flow in React Native with Context API & Hooks.
This app was done by following RocketSeat‘s Masterclass #12.
Although there’s no real external API calls, just for the sake of simplicity I’m mocking an API call at the start of the sign in flow. The services/auth.tsx
file mocks this request by returning the user object after a 2000 ms timeout (async).
You need a React Native CLI development environment setup in order to try this app.
Clone and install this repo:
$ git clone https://github.com/alande-amorim/react-native-auth.git
$ cd react-native-auth
$ yarn install
$ yarn start
Then launch this app on your emulator.
For me, I have to first open up the emulator and then:
$ yarn android