Skip to content

Commit

Permalink
Add note about parenthesis and link back to typescript guide.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brammm committed Oct 22, 2023
1 parent 8e17f5b commit 920af4b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/guides/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ nav: 8

## Basic usage

The difference when using TypeScript is that instead of writing `create(...)`, you have to write `create<T>()(...)` (notice the extra parenthesis `()` too along with the type parameter) where `T` is the type of the state to annotate it. For example:
The difference when using TypeScript is that instead of writing `create(...)`, you have to write `create<T>()(...)` (notice the extra parentheses `()` too along with the type parameter) where `T` is the type of the state to annotate it. For example:

```ts
import { create } from 'zustand'
Expand Down
2 changes: 2 additions & 0 deletions docs/integrations/immer-middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ npm install immer

## Usage

(Notice the extra parentheses after the type parameter as mentioned in the [Typescript Guide](../guides/typescript.md)).

Updating simple states

```ts
Expand Down

0 comments on commit 920af4b

Please sign in to comment.