React-Native TypeScript
This is a boilerplate code that can get you started for React-Native applications in TypeScript.
This boilerplate is designed to be as simplistic as it can be and is "ejected" by default.
Prerequisites
- NodeJS
- React Native Debugger
Setup
- Clone this repo with your application name as the second argument:
Then delete this repo's git history and initialize a new one.
$ git clone https://github.com/vjcagay/react-native-typescript.git <application-name> $ cd <application-name>
- Run
npm install
to install the dependencies. - Run
npm run setup
to create theandroid
andios
folders. - If you are running the iOS and Android emulators simultaneously (in a Mac) the Metro servers should be running on separate ports. You can do this by running
npm run start-ios
andnpm run start-android
on different terminal instances respectively. - To push the code to the simulators/devices you can run
npm run ios
andnpm run android
.
Testing and Linting
This boilerplate uses Jest and is preconfigured to be able to test TypeScript React-Native code.
TSLint is also included for linting TypeScript code.
Debugging
React Native Debugger is used by default since it offers more features out-of-the-box.
Contributing
Please file an issue if you find a bug or have concerns or make a pull request if you like some sensible changes!
Author
© vjcagay, Released under the MIT license.
References
https://github.com/react-community/create-react-native-app
https://github.com/Microsoft/TypeScript-React-Native-Starter