Skip to content

Commit da09961

Browse files
committed
added compatibility with rn 0.57+
1 parent 6052e12 commit da09961

File tree

5 files changed

+9
-35
lines changed

5 files changed

+9
-35
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ Clean and minimalist React Native template for a quick start with TypeScript.
1313
## :arrow_forward: Quick Start
1414

1515
```bash
16-
react-native init MyApp --template typescript
16+
react-native init MyApp --template typescript && node MyApp/setup.js
1717
```
1818

1919
## :question: FAQ
2020

2121
### Why this template when React Native 0.57+ supports TypeScript out of the box?
2222

23-
First of all, I started this template before React Native 0.57 came out. After React Native 0.57 was announced, I planned to stop maintaining this template. But I realized to properly set up a new React Native 0.57+ project, you still have to do manual work (add type definitions for React & React Naitve, create a `.tsconfig` for type checking, etc.). And that's where this template comes in and does that work for you. :raised_hands:
23+
First of all, I started this template before React Native 0.57 came out. After React Native 0.57 was announced, I planned to stop maintenance on this template. But after further evaluation, there's still some manual work to do (add type definitions for React & React Native, create a `.tsconfig` for type checking, etc.) to properly set up a React Native 0.57+ TypeScript project. And that's where this template comes in and does that work for you. :raised_hands:
2424

2525
### What additional dependencies are included in this template?
2626

@@ -35,16 +35,16 @@ Lots of :heart: and credits to the owners and maintainers of those packages.
3535

3636
It deletes obsolete files like the `.flowconfig` and the `setup.js` itself after the setup.
3737

38+
### How to do type checking?
39+
40+
`npm run tsc`
41+
3842
### Does debugging work?
3943

4044
Yes it does.
4145

4246
[![Demonstration of working breakpoints in Visual Studio Code](https://cdn-images-1.medium.com/max/1600/1*ZXfzgq1xKz1B3chYy9xE7w.png)](https://medium.com/@emin93/react-native-typescript-b965059109d3)
4347

44-
### How to do type checking?
45-
46-
`npm run tsc`
47-
4848
## :globe_with_meridians: Links
4949

5050
- ["Using React Native with TypeScript just became simple" on Medium](https://medium.com/@emin93/react-native-typescript-b965059109d3)

devDependencies.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,5 @@
33
"@types/react-native": "latest",
44
"@types/react-test-renderer": "latest",
55
"@types/react": "latest",
6-
"react-native-typescript-transformer": "latest",
7-
"ts-jest": "latest",
86
"typescript": "latest"
97
}

jest.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

rn-cli.config.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

setup.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@ const fs = require('fs')
22
const path = require('path')
33

44
const packageJson = require('./package.json')
5-
const jestConfig = require('./jest.json')
65

7-
const deleteFile = (fileName) => fs.unlinkSync(path.join(__dirname, fileName))
6+
const deleteFile = fileName => fs.unlinkSync(path.join(__dirname, fileName))
87
const writeFile = (fileName, data) => fs.writeFileSync(path.join(__dirname, fileName), data)
98

109
console.log('🔄 Setting up...')
1110

12-
packageJson.jest = Object.assign(packageJson.jest, jestConfig)
11+
packageJson.scripts.tsc = 'tsc'
12+
1313
writeFile('package.json', JSON.stringify(packageJson, null, 2))
1414

1515
deleteFile('.flowconfig')
1616
deleteFile('App.js')
17-
deleteFile('jest.json')
1817
deleteFile('LICENSE')
1918
deleteFile('README.md')
2019
deleteFile('setup.js')

0 commit comments

Comments
 (0)