Skip to content

Commit 4fcc178

Browse files
authored
Merge pull request #116 from aryaemami59/add-expo-ts-template
Add Expo template featuring RTK 2.0
2 parents d7e98e4 + 1783cce commit 4fcc178

35 files changed

+1426
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"extends": [
3+
"eslint:recommended",
4+
"@react-native",
5+
"plugin:react/jsx-runtime",
6+
"prettier"
7+
],
8+
"parser": "@typescript-eslint/parser",
9+
"parserOptions": { "project": true, "tsconfigRootDir": "./" },
10+
"plugins": ["@typescript-eslint"],
11+
"root": true,
12+
"rules": {
13+
"@typescript-eslint/consistent-type-imports": [
14+
2,
15+
{ "fixStyle": "separate-type-imports" }
16+
],
17+
"@typescript-eslint/no-restricted-imports": [
18+
2,
19+
{
20+
"paths": [
21+
{
22+
"name": "react-redux",
23+
"importNames": ["useSelector", "useStore", "useDispatch"],
24+
"message": "Please use pre-typed versions from `src/app/hooks.ts` instead."
25+
}
26+
]
27+
}
28+
]
29+
},
30+
"overrides": [
31+
{ "files": ["*.{c,m,}{t,j}s", "*.{t,j}sx"] },
32+
{ "files": ["*{test,spec}.{t,j}s?(x)"], "env": { "jest": true } }
33+
]
34+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
2+
3+
# dependencies
4+
node_modules/
5+
.yarn/
6+
package-lock.json
7+
yarn.lock
8+
9+
# Expo
10+
.expo/
11+
dist/
12+
web-build/
13+
14+
# Native
15+
*.orig.*
16+
*.jks
17+
*.p8
18+
*.p12
19+
*.key
20+
*.mobileprovision
21+
22+
# Metro
23+
.metro-health-check*
24+
25+
# debug
26+
npm-debug.*
27+
yarn-debug.*
28+
yarn-error.*
29+
30+
# macOS
31+
.DS_Store
32+
*.pem
33+
34+
# local env files
35+
.env*.local
36+
37+
# typescript
38+
*.tsbuildinfo
39+
40+
# IDE
41+
.vscode
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"arrowParens": "avoid",
3+
"semi": false
4+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Provider } from "react-redux"
2+
import { store } from "./src/app/store"
3+
4+
import { Main } from "./src/Main"
5+
6+
export const App = () => {
7+
return (
8+
<Provider store={store}>
9+
<Main />
10+
</Provider>
11+
)
12+
}
13+
14+
export default App
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Expo Template Redux TypeScript
2+
3+
The official Redux+TS template for Expo.
4+
5+
## :arrow_forward: Usage
6+
7+
```sh
8+
npx create-expo my-app --template expo-template-redux-typescript
9+
```
10+
11+
# Getting Started
12+
13+
> **Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding.
14+
15+
## Step 1: Start the Metro Server
16+
17+
First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native.
18+
19+
To start Metro, run the following command from the _root_ of your React Native project:
20+
21+
```bash
22+
# using npm
23+
npm start
24+
```
25+
26+
```bash
27+
# OR using Yarn
28+
yarn start
29+
```
30+
31+
## Step 2: Start your Application
32+
33+
Let Metro Bundler run in its _own_ terminal. Open a _new_ terminal from the _root_ of your React Native project. Run the following command to start your _Android_ or _iOS_ app:
34+
35+
### For Android
36+
37+
```bash
38+
# using npm
39+
npm run android
40+
```
41+
42+
```bash
43+
# OR using Yarn
44+
yarn android
45+
```
46+
47+
### For iOS
48+
49+
```bash
50+
# using npm
51+
npm run ios
52+
```
53+
54+
```bash
55+
# OR using Yarn
56+
yarn ios
57+
```
58+
59+
If everything is set up _correctly_, you should see your new app running in your _Android Emulator_ or _iOS Simulator_ shortly provided you have set up your emulator/simulator correctly.
60+
61+
This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively.
62+
63+
## Step 3: Modifying your App
64+
65+
Now that you have successfully run the app, let's modify it.
66+
67+
1. Open `App.tsx` in your text editor of choice and edit some lines.
68+
2. For **Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Developer Menu** (<kbd>Ctrl</kbd> + <kbd>M</kbd> (on Window and Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (on macOS)) to see your changes!
69+
70+
For **iOS**: Hit <kbd>Cmd ⌘</kbd> + <kbd>R</kbd> in your iOS Simulator to reload the app and see your changes!
71+
72+
## Congratulations! :tada:
73+
74+
You've successfully run and modified your Expo App. :partying_face:
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"expo": {
3+
"name": "expo-template-redux-typescript",
4+
"slug": "expo-template-redux-typescript",
5+
"version": "1.0.0",
6+
"orientation": "portrait",
7+
"icon": "./assets/icon.png",
8+
"userInterfaceStyle": "automatic",
9+
"splash": {
10+
"image": "./assets/splash.png",
11+
"resizeMode": "contain",
12+
"backgroundColor": "#ffffff"
13+
},
14+
"assetBundlePatterns": ["**/*"],
15+
"ios": {
16+
"supportsTablet": true
17+
},
18+
"android": {
19+
"adaptiveIcon": {
20+
"foregroundImage": "./assets/adaptive-icon.png",
21+
"backgroundColor": "#ffffff"
22+
}
23+
},
24+
"web": {
25+
"favicon": "./assets/favicon.png"
26+
}
27+
}
28+
}
17.1 KB
Loading
1.43 KB
Loading
21.9 KB
Loading
46.2 KB
Loading

0 commit comments

Comments
 (0)