Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions docs/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ npx create-expo-app --template
<TabItem value="npm">

```shell
npm install -D @tsconfig/react-native @types/jest @types/react @types/react-test-renderer @typescript-eslint/eslint-plugin @typescript-eslint/parser typescript
npm install -D @tsconfig/react-native @types/jest @types/react @types/react-test-renderer typescript
```

</TabItem>
<TabItem value="yarn">

```shell
yarn add --dev @tsconfig/react-native @types/jest @types/react @types/react-test-renderer @typescript-eslint/eslint-plugin @typescript-eslint/parser typescript
yarn add --dev @tsconfig/react-native @types/jest @types/react @types/react-test-renderer typescript
```

</TabItem>
Expand All @@ -50,22 +50,11 @@ This command adds the latest version of every dependency. The versions may need
}
```

3. Update your `.eslintrc.js` to enable TypeScript specific linting rules:

```diff
module.exports = {
root: true,
extends: '@react-native-community',
+ parser: '@typescript-eslint/parser',
+ plugins: ['@typescript-eslint'],
};
```

4. Rename a JavaScript file to be `*.tsx`
3. Rename a JavaScript file to be `*.tsx`

> You should leave the `./index.js` entrypoint file as it is otherwise you may run into an issue when it comes to bundling a production build.

5. Run `yarn tsc` to type-check your new TypeScript files.
4. Run `yarn tsc` to type-check your new TypeScript files.

## Using JavaScript Instead of TypeScript

Expand Down