useStateWithHistory had an issue when the initialState is a function.
The back function breaks due to the history's first value remaining as a function.
I fixed this so the resolved value to be stored in history.
fixes #2568
Type of change
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change(fix or feature that would cause existing functionality to not work as before)
Description
useStateWithHistory had an issue when the initialState is a function. The back function breaks due to the history's first value remaining as a function.
I fixed this so the resolved value to be stored in history.
fixes #2568
Type of change
Checklist
yarn test
)yarn lint
). Fix it withyarn lint:fix
in case of failure.yarn lint:types
).