Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(types)(middleware/devtools): avoid copying types #1991

Merged
merged 8 commits into from
Oct 2, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add a note about devtools and typescript
  • Loading branch information
dai-shi committed Aug 12, 2023
commit 3be92c087b1fa5ff1a66964ce4d7cf6799c0d541
9 changes: 9 additions & 0 deletions docs/recipes/recipes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,15 @@ Optionally, you can name the store with a second argument `devtoolsOptions`:
unlike in a typical _combined reducers_ Redux store.
See an approach to combining stores [here](https://github.com/pmndrs/zustand/issues/163).

#### Use it with TypeScript

It's recommended to install and import types from`@redux-devtools/extension` to get types correctly.

```ts
import type {} from '@redux-devtools/extension'
import { devtools } from 'zustand/middleware'
```

## TypeScript

```tsx
Expand Down