We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug : The following code, undo(), but the list will not be popped
const form = useForm({ initialValues: initialValues, }) const [countState, { set: setCount, reset: resetCount, undo, redo, canUndo, canRedo }] = useUndo(initialValues) const { present: presentCount, past, future } = countState useEffect(() => { setCount(form.values) console.log('form.values', form.values) }, [form.values]) console.log('当前values', form.values) const onUndo = () => { if (!canUndo) return const nextState = past.at(-1) if (!nextState) return undo() console.log('onUndo', nextState) form.setValues(nextState) } console.log('past', past) console.log('future', future) const onRedo = () => { if (!canRedo) return const nextState = future.at(-1) if (!nextState) return redo() form.setValues(nextState) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
bug : The following code, undo(), but the list will not be popped
The text was updated successfully, but these errors were encountered: