Skip to content
New issue

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

Wrong typing for getState? #688

Open
addlistener opened this issue Jul 27, 2024 · 0 comments
Open

Wrong typing for getState? #688

addlistener opened this issue Jul 27, 2024 · 0 comments

Comments

@addlistener
Copy link

addlistener commented Jul 27, 2024

Describe the bug

The code returns state.current

const getState = useCallback(() => stateRef.current, []);

The types is exposed to useEditor and store.getState() return state.current but the typing is {prev, current}

getState: () => { prev: StateFor<M>; current: StateFor<M> };

They do not match

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant