rn-initapp-typescript-template
React Native Project using Typescript. This Template includes SplashScreen Setup, Custom Statusbar Setup, Custom Header, Custom TextBox , Custom Font Family Setup, Redux Setup, Axios Call Setup, Reanimated for Animations, SVG Setup, Stack navigations, Tab and Custom Drawer Navigations Setup.
In-Built Packages
react-native-splash-screen
1.react-native-svg
2.react-native-svg-transformer
3.react-redux
4.redux
5.axios
6.react-native-reanimated
7.react-native-gesture-handler
8.@react-navigation/native
9.react-native-screens
10.react-native-safe-area-context
11.@react-navigation/native-stack
12.@react-navigation/drawer
13.@react-navigation/bottom-tabs
14.Installation
From NPM
npx react-native init ProjectName --template rn-initapp-typescript-template
From Github
npx react-native init ProjectName --template https://github.com/senthalan2/rn-initapp-typescript-template.git
Steps after Project Initialization
1. Set SplashScreen Image
Android
- Go to
android/app/src/main/res/drawable
, put splash image (.png) in this directory and named it aslaunch_screen
( Refer below Image ).
- Change code in
android/app/src/main/res/layout/launch_screen.xml
file.
IOS
- Open XCode, Under your Project, Select
Images
and Selectsplash_image
. Create three different sizes of your image (@1x, @2x, @3x) and add the images by dragging them into the slots for 1x, 2x, 3x ( shown in below image ).
- To change Background Color, Select
LaunchScreen
SelectView
underView
and choose background Color ( shown in below image).
2. Set Custom Fonts
Drop the custom font family files (.ttf) into the assets/fonts
directory under your project root directory ( shown in below image ).
After the above step, run the below command to link the assets with android and ios.
npx react-native link
Custom Fonts Setup Completed. Run your project.
Usage of Custom Font Families
Add the Font family name in Src/Utilities/GlobalFonts.js
( Refer below image ).
Import and Use the fonts wherever you want. ( Refer below image ).