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

"Next" type removed in version 0.5.1 #13

Closed
DaniGuardiola opened this issue Oct 1, 2021 · 2 comments
Closed

"Next" type removed in version 0.5.1 #13

DaniGuardiola opened this issue Oct 1, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@DaniGuardiola
Copy link
Contributor

DaniGuardiola commented Oct 1, 2021

I relied on that type for a workaround:

import type {
  Next,
  OnKeyDown,
} from "use-slate-with-extensions";

const onKeyDown: OnKeyDown = <T,>(
  event: React.KeyboardEvent<T>,
  editor: SlateEditor,
  next?: Next<OnKeyDown>
) => {
  // ...
}

I believe this is because of an issue that was caused by the OnKeyDown type having KeyboardEvent<{}>. I did this to turn it into a generic which did fix my issue. I wonder if that should be part of the lib typings, or is there any particular reason the {} type is being used here instead of a generic?

@DaniGuardiola DaniGuardiola added the bug Something isn't working label Oct 1, 2021
lukesmurray added a commit that referenced this issue Oct 4, 2021
onKeyDown was using an object but it can use a generic element.

Based on comment in #13.
@lukesmurray
Copy link
Owner

Fixed in 0.5.2

@lukesmurray
Copy link
Owner

Also made onKeyDown a generic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants