react-use
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.
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
Same as #2061