Skip to content

Commit

Permalink
Fix: Fixed typos (#745)
Browse files Browse the repository at this point in the history
  • Loading branch information
JMarques1196 authored Oct 14, 2024
1 parent c5133da commit 99b7f9c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/advanced/patterns_by_usecase.md
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ function handle(event: UserEvent) {

<details>
<summary>
Take care: TypeScript does not narrow the type of a Discriminated Union on the basis of typeof checks. The type guard has to be on the value of a key and not it's type.
Take care: TypeScript does not narrow the type of a Discriminated Union on the basis of typeof checks. The type guard has to be on the value of a key and not its type.
</summary>

```ts
Expand All @@ -589,7 +589,7 @@ function handle(event: UserEvent) {
}
```

The above example does not work as we are not checking the value of `event.value` but only it's type. Read more about it [microsoft/TypeScript#30506 (comment)](https://github.com/microsoft/TypeScript/issues/30506#issuecomment-474858198)
The above example does not work as we are not checking the value of `event.value` but only its type. Read more about it [microsoft/TypeScript#30506 (comment)](https://github.com/microsoft/TypeScript/issues/30506#issuecomment-474858198)

</details>

Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/utility-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ We will assume knowledge of utility types covered in the sister project [`typesc

If you intend to maintain a large TS codebase/a nontrivial React+TS library, **we strongly recommend exploring these utilities** so that you don't reinvent the wheel and/or lose sanity trying to do so. Studying their code can also teach you a lot of advanced TS that is not covered here.

I also recommend have a good working knowledge of how to construct the inbuilt utility types from scratch. See [Dr. Rauschmayer's guide](https://2ality.com/2020/06/computing-with-types.html) for a concise introduction.
I also recommend having a good working knowledge of how to construct the inbuilt utility types from scratch. See [Dr. Rauschmayer's guide](https://2ality.com/2020/06/computing-with-types.html) for a concise introduction.

A level of comfort with **generic types** is therefore required. Here are some helpful resources:

Expand Down
2 changes: 1 addition & 1 deletion docs/hoc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ title: HOC Cheatsheet

- We will map closely to [the official docs on HOCs](https://reactjs.org/docs/higher-order-components.html) initially
- While hooks exist, many libraries and codebases still have a need to type HOCs.
- Render props may be considered in future
- Render props may be considered in the future
- The goal is to write HOCs that offer type safety while not getting in the way.

Here is a base HOC example you can copy right away:
Expand Down

0 comments on commit 99b7f9c

Please sign in to comment.