fix(docs): Fix Immer import (#2029)

* Fix Immer import

The `produce` function is a named export, not a default export:

https://immerjs.github.io/immer/produce

* Fix other references to "produce" as well.
This commit is contained in:
Frederik De Bleser 2023-09-07 01:12:20 +02:00 committed by GitHub
parent b8b5b636ce
commit 0ab1c0a974
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -221,7 +221,7 @@ Reducing nested structures is tiresome.
Have you tried [Immer](https://github.com/immerjs/immer)?
```jsx
import produce from 'immer'
import { produce } from 'immer'
const useStore = create((set) => ({
lush: { forest: { contains: { a: 'bear' } } },
@ -270,7 +270,7 @@ const useStore = create(
```js
import { create } from 'zustand'
import produce from 'immer'
import { produce } from 'immer'
import pipe from 'ramda/es/pipe'
/* log and immer functions from previous example */
@ -294,7 +294,7 @@ For a TS example see the following [discussion](https://github.com/pmndrs/zustan
```ts
import { State, StateCreator } from 'zustand'
import produce, { Draft } from 'immer'
import { produce, Draft } from 'immer'
// Immer V8 or lower
const immer =