Skip to content

Commit 49dff1a

Browse files
authored
Merge pull request #2559 from code0monkey1/patch-5
Typo
2 parents 83f598d + b100a27 commit 49dff1a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/content/9/en/part9d.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ The type of the returned array is the following:
677677
[string, React.Dispatch<React.SetStateAction<string>>]
678678
```
679679
680-
So the first element, assignd to _newNote_ is a string and the second element that we assigned _setNewNote_ has a slightly more complex type. We notice that there is a string mentioned there, so we know that it must be the type of a function that sets a valued data. See [here](https://codewithstyle.info/Using-React-useState-hook-with-TypeScript/) if you want to learn more about the types of useState function.
680+
So the first element, assigned to _newNote_ is a string and the second element that we assigned _setNewNote_ has a slightly more complex type. We notice that there is a string mentioned there, so we know that it must be the type of a function that sets a valued data. See [here](https://codewithstyle.info/Using-React-useState-hook-with-TypeScript/) if you want to learn more about the types of useState function.
681681
682682
From this all we see that TypeScript has indeed [inferred](https://www.typescriptlang.org/docs/handbook/type-inference.html#handbook-content) the type of the first useState quite right, it is creating a state with type string.
683683

0 commit comments

Comments
 (0)