immerjs / use-immer

Use immer to drive state with a React hooks
MIT License
4.04k stars 92 forks source link

when useImmer use in an async function #83

Closed galileo303 closed 3 years ago

galileo303 commented 3 years ago

Now I change the input value in a async request, then useImmer's produce 'setObj' can't render the React function component. It do nothing? the code: image

the print: image

React Version:^16.12.0 use-immer Version:^0.5.1

mweststrate commented 3 years ago

Please provide a reproduction in e.g. codesandbox

On Mon, 26 Apr 2021, 08:59 galileo303, @.***> wrote:

Now I change the input value in a async request, then useImmer's produce 'setObj' can't render the React function component. It do nothing? the code: [image: image] https://user-images.githubusercontent.com/17979785/116047937-355d7a80-a6a7-11eb-8f14-1ad5fd1646dc.png

the print: [image: image] https://user-images.githubusercontent.com/17979785/116048466-ca607380-a6a7-11eb-9300-96e9988e01b0.png

React Version:^16.12.0 use-immer Version:^0.5.1

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/immerjs/use-immer/issues/83, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN4NBDAUMHRBHA7XZBNMU3TKUMOLANCNFSM43SKSZNA .