You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### An opinionated [React Native](https://facebook.github.io/react-native/docs/getting-started) Starter Kit with [React Native Navigation v7](https://github.com/wix/react-native-navigation) + [Redux](https://github.com/reactjs/redux) + [TSLint](https://github.com/airbnb/javascript) to build iOS / Android apps using [TypeScript](https://github.com/Microsoft/TypeScript-React-Native-Starter)
5
+
### An opinionated [React Native](https://facebook.github.io/react-native/docs/getting-started) Starter Kit with [React Native Navigation](https://github.com/wix/react-native-navigation) + [Redux](https://github.com/reactjs/redux) + [Airbnb TSLint](https://github.com/airbnb/javascript) to build iOS and Android apps using [TypeScript](https://github.com/Microsoft/TypeScript-React-Native-Starter)
6
6
7
7
The project has been setup based off [RN Getting Started](https://facebook.github.io/react-native/docs/getting-started) and instructions from [Microsoft's Github TypeScript React Native Starter](https://github.com/Microsoft/TypeScript-React-Native-Starter) repo.
8
8
9
-
### Supports React Native 0.63.3 and React Native Navigation v7
This repo supports the latest version of React Native compatible with React Native Navigation.
12
12
@@ -20,17 +20,17 @@ This repo supports the latest version of React Native compatible with React Nati
20
20
21
21
### Who is this for?
22
22
23
-
Someone looking to jumpstart building apps using RN and prefers TypeScript. The base setup has been taken care of, just `yarn install` and get going from respective IDEs.
23
+
Jumpstart building robust apps using React Native, with TypeScript. The base setup has been taken care of, just `yarn install` and get going from respective IDEs.
24
24
25
25
You might also want to [rename](https://medium.com/the-react-native-log/how-to-rename-a-react-native-app-dafd92161c35) the app for your own use.
26
26
27
27
> _Disclaimer_: This is an **opinionated** approach to building apps with RN. The project structure is inspired by multiple production apps built by the contributors.
28
28
29
-
The project uses and encourages to use industry best practices / tools / libraries like React Native Navigation, redux, tslint, separation of concern and structure to build a maintainable app.
@@ -52,7 +52,7 @@ The project uses and encourages to use industry best practices / tools / librari
52
52
├── android Android Native code
53
53
├── ios iOS Native Code
54
54
├── shared
55
-
│ ├── redux Business Logic
55
+
│ ├── redux Applications Logic
56
56
│ │ ├── constants
57
57
│ │ ├── actions
58
58
│ │ ├── api
@@ -61,10 +61,10 @@ The project uses and encourages to use industry best practices / tools / librari
61
61
│ │ └── thunk
62
62
│ └── utilities
63
63
├── src
64
-
│ ├── config App Configuration
64
+
│ ├── config Global Configuration
65
65
│ ├── constants Screens, Localization
66
66
│ ├── navigators Router, Navigation
67
-
│ ├── view UI compoments - Screens, Widgets
67
+
│ ├── view UI compoments
68
68
│ │ ├── elements Custom elements
69
69
│ │ ├── assets
70
70
│ │ ├── screens
@@ -92,12 +92,9 @@ Everything related to application business logic (store) resides under this dire
92
92
`src`
93
93
Only presentation layer for the app, styles, images, icons are meant to be under this.
94
94
95
-
`web`
96
-
Going forward, plan is to add a web folder to the project, that can leverage the business logic from shared folder.
97
-
98
95
#### Running
99
96
100
-
Make sure node version installed is `>=8.11.x <=9`
97
+
Make sure node version installed is `>=10.x.x`
101
98
102
99
```
103
100
yarn install
@@ -107,6 +104,10 @@ yarn install
107
104
108
105
###### iOS
109
106
107
+
```
108
+
cd ios && pod install
109
+
```
110
+
110
111
Launch application from XCode
111
112
112
113
###### Android
@@ -121,13 +122,13 @@ and then launch from IDE.
121
122
122
123
#### Lint
123
124
124
-
To run tslint on the application:
125
+
To run lint on the application:
125
126
126
127
```
127
128
yarn lint
128
129
```
129
130
130
-
To fix most tslint issues automatically
131
+
Fixes most tslint issues automatically:
131
132
132
133
```
133
134
yarn lint:fix
@@ -151,22 +152,24 @@ npm run test:coverage
151
152
152
153
#### Cheat Sheet
153
154
154
-
##### React Native Navigation
155
+
##### Single Screen vs Tabbed Based Navigation
156
+
157
+
The application launches with a splash screen, and then moves to a tabbed based navigation. Splash screen is a good place to fetch data / build application launch logic like getting user token from API or Async Store, load persist state etc.
155
158
156
-
The application launches with a blank splash screen, and then moves to a tabbed based home view. Developers can feel free to add application launch logic to this, like fetch user token, load persist state etc., or skip the splash if not required, or change this setup altogether.
159
+
For Single screen application, replace this tabbed based navigation with a single screen - just `home`, or simply use the splash screen to setup the app, may be with a burger menu.
157
160
158
161
##### Styles
159
162
160
-
The `styles` folder contains `global` style and `typography` for the application. Styles for each screen has been placed with the screen, as they are going to be used together with the screen, unlike web.
163
+
The `styles` folder contains `global` style and `typography` for the application. Styles for each screen has been placed with the screen, as they are used together with the screen, unlike web.
161
164
162
165
##### Widgets / Elements
163
166
164
167
The custom components have been broken into 2 major categories, namely - **widgets**, **elements**
165
168
166
169
A Good use case would be:
167
170
168
-
- widgets: carousels component, banner component, any component providing a complete functionality
169
-
- elements: A custom, may be `<CText>` or `<ButtonDefault>`, element that has default font properties like font, size and overrides the native elements.
171
+
-**widgets**: Any componentproviding a complete functionality. Like carousels component, banner component, etc.
172
+
-**elements**: Smallest building blocks of application. A custom element, may be `<ButtonPrimary>` or `<CText>`, that has default font properties like font, size and so on.
170
173
171
174
#### Contributing
172
175
@@ -178,8 +181,4 @@ Please check out [Contributing](https://github.com/AmitM30/react-native-typescri
0 commit comments