Building a Simple React Native App w/ React-Router-Native

@jimthedev

Sr Consultant @ Object Partners Inc.

https://slides.com/jimthedev/react-router-native

https://slides.com/jimthedev/react-router-native

Install create-react-native-app command line

https://facebook.github.io/react-native/docs/getting-started.html

 

Install Expo

https://expo.io/tools

 

https://slides.com/jimthedev/react-router-native

Create a New React Native App

create-react-native-app BugFinder

 

Open the BugFinder directory in Expo

Do not run npm start

 

Install the NativeBase (bootstrap for react-native)

npm install native-base @expo/vector-icons  --save

https://slides.com/jimthedev/react-router-native

Add a login form

 

Great but now I only have a login form. What if I want a sign up form?

 

 npm install --save react-router-native

https://slides.com/jimthedev/react-router-native

Does the current route match this path?

Yes => Render this component

What is a navigator (react-navigation)?

Does the current route match this path?

Yes => Render this component

Does the current route match this path?

Yes => Render this component

Regular (stack) navigator path: /

/bugs

/bugs/1

Tabs navigator path:

Regular (stack) navigator path:

https://slides.com/jimthedev/react-router-native

Unfortunately it falls apart with multiple navigators!

/

/bugs/

Tabs navigation

Regular front-back navigation

< User clicks!

We have to have cross navigator communication. Ew.

(also broken in react-navigation)

/bugs/1

Regular front-back navigation

Building a React Native Router with React-Router-Native

By jimthedev

Building a React Native Router with React-Router-Native

  • 1,334