Skip to content

Commit fed6348

Browse files
committed
Merge pull request #94 from jpangelle/master
Fix grammar/semantic issues, clean up whitespace
2 parents a6006fb + 0a69182 commit fed6348

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ This guide will always assume you are starting with the latest TypeScript versio
8282

8383
## React + TypeScript Starter Kits
8484

85-
1. [Create React App v2.1+ with Typescript](https://facebook.github.io/create-react-app/docs/adding-typescript): `npm create react-app my-new-react-typescript-app --typescript`
85+
1. [Create React App v2.1+ with Typescript](https://facebook.github.io/create-react-app/docs/adding-typescript): `npx create-react-app my-new-react-typescript-app --typescript`
8686

8787
- We used to recommend `create-react-app-typescript` but it is now [deprecated](https://www.reddit.com/r/reactjs/comments/a5919a/createreactapptypescript_has_been_archived_rip/). [see migration instructions](https://vincenttunru.com/migrate-create-react-app-typescript-to-create-react-app/)
8888

@@ -427,15 +427,15 @@ let el = <Greet />;
427427
```
428428
<details>
429429
<summary>Why does React.FC break defaultProps?</summary>
430-
430+
431431
You can check the discussions here:
432-
432+
433433
- https://medium.com/@martin_hotell/10-typescript-pro-tips-patterns-with-or-without-react-5799488d6680
434434
- https://github.com/DefinitelyTyped/DefinitelyTyped/issues/30695
435435
- https://github.com/sw-yx/react-typescript-cheatsheet/issues/87
436-
436+
437437
This is just the current state and may be fixed in future.
438-
438+
439439
</details>
440440

441441
<details>
@@ -750,7 +750,7 @@ _Not written yet._ watch <https://github.com/sw-yx/fresh-async-react> for more o
750750

751751
# Basic Troubleshooting Handbook: Types
752752

753-
Facing weird type errors? You aren't alone. This is the hardest part of using TypeScript with React. Be patience - you are learning a new language after all. However, the more you get good at this, the less time you'll be working _against_ the compiler and the more the compiler will be working _for_ you!
753+
Facing weird type errors? You aren't alone. This is the hardest part of using TypeScript with React. Be patient - you are learning a new language after all. However, the more you get good at this, the less time you'll be working _against_ the compiler and the more the compiler will be working _for_ you!
754754

755755
Try to avoid typing with `any` as much as possible to experience the full benefits of typescript. Instead, let's try to be familiar with some of the common strategies to solve these issues.
756756

@@ -804,7 +804,7 @@ function isAdmin(usr: Admin | User): usr is Admin {
804804
}
805805
```
806806

807-
If you need `if/elseif` chains or the `switch` statement instead, it should "just work", but look up [Discriminated Unions](https://www.typescriptlang.org/docs/handbook/advanced-types.html) if you need help. (See also: [Basarat's writeup](https://basarat.gitbooks.io/typescript/docs/types/discriminated-unions.html)). This is handy in typing reducers for `useReducer` or Redux.
807+
If you need `if...else` chains or the `switch` statement instead, it should "just work", but look up [Discriminated Unions](https://www.typescriptlang.org/docs/handbook/advanced-types.html) if you need help. (See also: [Basarat's writeup](https://basarat.gitbooks.io/typescript/docs/types/discriminated-unions.html)). This is handy in typing reducers for `useReducer` or Redux.
808808

809809
## Optional Types
810810

@@ -978,7 +978,7 @@ type FooReturn = ReturnType<typeof foo>; // { baz: number }
978978
Use [declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html):
979979

980980
```ts
981-
// declaration.d.ts
981+
// declaration.d.ts
982982
// anywhere in your project, NOT the same name as any of your .ts/tsx files
983983
declare module '*.png'
984984

@@ -990,7 +990,7 @@ Related issue: https://github.com/Microsoft/TypeScript-React-Starter/issues/12 a
990990

991991
# Troubleshooting Handbook: TSLint
992992

993-
Sometimes TSLint is just getting in the way. Judicious turning off of things can be helpful. Here are useful tslint disables you may use:
993+
Sometimes TSLint is just getting in the way. Judiciously turning off of things can be helpful. Here are useful tslint disables you may use:
994994

995995
- `/* tslint:disable */` total disable
996996
- `// tslint:disable-line` just this line

0 commit comments

Comments
 (0)