Viktor Chernodub
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
3 deletions
-
beta/src/content/learn/updating-objects-in-state.md
|
@ -672,9 +672,8 @@ The `draft` provided by Immer is a special type of object, called a [Proxy](http |
|
|
|
|
|
|
|
|
To try Immer: |
|
|
To try Immer: |
|
|
|
|
|
|
|
|
1. Add `use-immer` to your `package.json` as a dependency |
|
|
1. Run `npm install use-immer` to add Immer as a dependency |
|
|
2. Run `npm install` |
|
|
2. Then replace `import { useState } from 'react'` with `import { useImmer } from 'use-immer'` |
|
|
3. Then replace `import { useState } from 'react'` with `import { useImmer } from 'use-immer'` |
|
|
|
|
|
|
|
|
|
|
|
Here is the above example converted to Immer: |
|
|
Here is the above example converted to Immer: |
|
|
|
|
|
|
|
|