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](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
-
This repo supports the latest version of React Native supported by React Native Navigation.
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.
21
24
22
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.
23
26
24
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.
25
28
26
-
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.
-[Single Screen vs Tabbed Based Navigation](#single-screen-vs-tabbed-based-navigation)
40
46
-[Styles](#styles)
41
47
-[Widgets / Elements](#widgets---elements)
42
48
-[Contributing](#contributing)
@@ -49,7 +55,7 @@ The project uses and encourages to use industry best practices / tools / librari
49
55
├── android Android Native code
50
56
├── ios iOS Native Code
51
57
├── shared
52
-
│ ├── redux Business Logic
58
+
│ ├── redux Applications Logic
53
59
│ │ ├── constants
54
60
│ │ ├── actions
55
61
│ │ ├── api
@@ -58,10 +64,10 @@ The project uses and encourages to use industry best practices / tools / librari
58
64
│ │ └── thunk
59
65
│ └── utilities
60
66
├── src
61
-
│ ├── config App Configuration
67
+
│ ├── config Global Configuration
62
68
│ ├── constants Screens, Localization
63
69
│ ├── navigators Router, Navigation
64
-
│ ├── view UI compoments - Screens, Widgets
70
+
│ ├── view UI compoments
65
71
│ │ ├── elements Custom elements
66
72
│ │ ├── assets
67
73
│ │ ├── screens
@@ -89,12 +95,9 @@ Everything related to application business logic (store) resides under this dire
89
95
`src`
90
96
Only presentation layer for the app, styles, images, icons are meant to be under this.
91
97
92
-
`web`
93
-
Going forward, plan is to add a web folder to the project, that can leverage the business logic from shared folder.
94
-
95
98
#### Running
96
99
97
-
Make sure node version installed is `>=8.11.x <=9`
100
+
Make sure node version installed is `>=10.x.x`
98
101
99
102
```
100
103
yarn install
@@ -104,6 +107,10 @@ yarn install
104
107
105
108
###### iOS
106
109
110
+
```
111
+
cd ios && pod install
112
+
```
113
+
107
114
Launch application from XCode
108
115
109
116
###### Android
@@ -118,13 +125,13 @@ and then launch from IDE.
118
125
119
126
#### Lint
120
127
121
-
To run tslint on the application:
128
+
To run lint on the application:
122
129
123
130
```
124
131
yarn lint
125
132
```
126
133
127
-
To fix most tslint issues automatically
134
+
Fixes most tslint issues automatically:
128
135
129
136
```
130
137
yarn lint:fix
@@ -148,22 +155,24 @@ npm run test:coverage
148
155
149
156
#### Cheat Sheet
150
157
151
-
##### React Native Navigation
158
+
##### Single Screen vs Tabbed Based Navigation
159
+
160
+
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.
152
161
153
-
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.
162
+
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.
154
163
155
164
##### Styles
156
165
157
-
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.
166
+
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.
158
167
159
168
##### Widgets / Elements
160
169
161
170
The custom components have been broken into 2 major categories, namely - **widgets**, **elements**
162
171
163
172
A Good use case would be:
164
173
165
-
- widgets: carousels component, banner component, any component providing a complete functionality
166
-
- elements: A custom, may be `<CText>` or `<ButtonDefault>`, element that has default font properties like font, size and overrides the native elements.
174
+
-**widgets**: Any componentproviding a complete functionality. Like carousels component, banner component, etc.
175
+
-**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.
167
176
168
177
#### Contributing
169
178
@@ -175,8 +184,4 @@ Please check out [Contributing](https://github.com/AmitM30/react-native-typescri
0 commit comments