Skip to content

RN template featuring developer utilities like typescript, pre-commit hooks, build validation scripts, @testing-library setup and CI/CD

License

Notifications You must be signed in to change notification settings

ovistoica/react-native-modern-template

Repository files navigation

React Native Modern Template

A starter React Native project with many development utilities


Build Status Documentation Maintenance License: MIT

⭐ Features

🔧 Setup

  • Use this template
  • Replace every occurence of templateApp with the name of your app
  • Follow normal react native instructions

⚡ Usage

Commit Hooks

When you commit changes to your project, husky will run:

  • typescript checks
  • eslint
  • prettier formatting

If any of them fail, the commit will not be made. If you want to bypass the checks, add --no-verify as a parameter to git commit.

🚀 CI/CD

To setup Travis, simply go to the Travis Website and setup your repo to support Travis. That is it 😃

After you commit to master, or when a PR is opened, Travis will validate the build. This includes:

  • typescript checks
  • eslint
  • prettier formatting
  • javascript build using metro

🐛 Testing

This template includes @testing-library/react-native, with already made jest setup. Here you can find the motivation for using this library instead of shallow rendering from enzyme.

The template includes two small tests but read the Docs to fully understand how to use.

Inspiration

A big thank you 🙏 to Kent C. Dodds. This repo is takes many good practices from his examples. To learn more about testing and good development tools, go to testingjavascript.com (you won't regret purchasing it).

This template is based on RN Typescript Template

🔖 License

This project is MIT licensed.