mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
Fix punctuation. (#6815)
* Update typescript.md Fix punctuation. * Update src/content/learn/typescript.md --------- Co-authored-by: Ricky <rickhanlonii@gmail.com>
This commit is contained in:
@@ -137,7 +137,7 @@ The [`useState` Hook](/reference/react/useState) will re-use the value passed in
|
||||
const [enabled, setEnabled] = useState(false);
|
||||
```
|
||||
|
||||
Will assign the type of `boolean` to `enabled`, and `setEnabled` will be a function accepting either a `boolean` argument, or a function that returns a `boolean`. If you want to explicitly provide a type for the state, you can do so by providing a type argument to the `useState` call:
|
||||
This will assign the type of `boolean` to `enabled`, and `setEnabled` will be a function accepting either a `boolean` argument, or a function that returns a `boolean`. If you want to explicitly provide a type for the state, you can do so by providing a type argument to the `useState` call:
|
||||
|
||||
```ts
|
||||
// Explicitly set the type to "boolean"
|
||||
|
||||
Reference in New Issue
Block a user