Skip to content

Commit 570a268

Browse files
author
David Sheldrick
committed
update README, add LICENSE
1 parent 50977c0 commit 570a268

File tree

2 files changed

+51
-4
lines changed

2 files changed

+51
-4
lines changed

LICENSE

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2017 David Sheldrick
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

README.md

+32-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,41 @@
11
# react-native-typescript-transformer
22

3-
A transformer to use for loading TypeScript files with react-native.
3+
A transformer to use for loading TypeScript files with react-native >= 0.45
44

55
## Usage
66

7-
yarn add -D react-native-typescript-transformer
7+
yarn add -dev react-native-typescript-transformer typescript
88

9-
for 0.44, add `--transformer node_modules/react-native-typescript-transformer`
10-
to your `react-native` cli invocation, or provide an implementation for `getTransformModulePath` in `rn-cli.config.js`.
9+
Make sure your tsconfig.json has the following:
10+
11+
```json
12+
{
13+
"compilerOptions": {
14+
"target": "es2015",
15+
"module": "es2015",
16+
"jsx": "react-native",
17+
"allowSyntheticDefaultImports": true
18+
}
19+
}
20+
```
21+
22+
And add this to your rn-cli.config.json (make one if you don't have one already):
23+
24+
```js
25+
module.exports = {
26+
getTransformModulePath() {
27+
return require.resolve('react-native-typescript-transformer')
28+
},
29+
getProjectRoots() {
30+
return [__dirname];
31+
},
32+
getSourceExts() {
33+
return ['ts', 'tsx'];
34+
}
35+
}
36+
```
37+
38+
And you should be you good to go!
1139

1240
## License
1341

0 commit comments

Comments
 (0)