react-use icon indicating copy to clipboard operation
react-use copied to clipboard

useStateWithHistory: when click make step second time, history stack has four state records, expect three state records including the initial one state.

Open dadanliu opened this issue 3 years ago • 1 comments

What is the current behavior? when click make step second time, history stack has four state records, expect three state records including the initial one state.

Steps to reproduce it and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have extra dependencies other than react-use. Paste the link to your JSFiddle or CodeSandbox example below: https://codesandbox.io/s/strange-driscoll-21f74x?file=/src/App.js:104-109 What is the expected behavior? s, expect three state records including the initial one state when clicked twice make step button A little about versions:

  • OS: mac m1
  • Browser (vendor and version): chrome
  • React: ^18.2.0
  • react-use: ^17.4.0
  • _Did this worked in the previous package version?_no

dadanliu avatar Dec 10 '22 09:12 dadanliu

Same as #2061

mxzinke avatar Sep 04 '24 08:09 mxzinke