As a best practice when you start a react native project you could take into consideration using a static type checker. We will start talking about flow and how we can use it with react native.
If you don’t know what is flow, I encourage you to take a look at the docs, but as a general idea flow is a static type checker for JavaScript. For react on the other hand we can use PropTypes witch is already into react.
Flow or PropTypes ?
Well with PropTypes you can add rules just for the component props and can give you warnings, which is a good way to find bad code and fix it, on the other hand, Flow is allowing you to add a type annotation to all of your code and catch all the bugs at compile time.

Flow with react native
Let’s start by adding flow to react-native. If you start a fresh project with
and you open react-native init
the file you will see at the beginning that Flow is already there, but we need to make some changes to have it in action. App.js

You will find also a
file where you can add configurations, is like .flowconfig
for eslint. New react-native projects come with a .eslintrc
. Now next step is to install .flowconfig
package with flow-bin
. I added this version because if you check yarn add flow-bin@0.86
you will see what .flowconfig
you need to install. So open flow-bin
file first and look at the end of the file to get your version number..flowconfig

Now after we added flow package we need to do some changes in
file and add flow command.package.json
"scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "test": "jest", "flow": "flow" },
You can run with:
or yarn run flow
npm run flow

Now you have flow installed, don’t forget to add
to the beginning of components to write good code. Check also how to add Redux to your project or because we learned how to add flow you can add also prettier and eslint for a better configuration.@flow