mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-31 10:51:44 +02:00
fix: Slate editor props (#3359)
* fix: Slate editor props TS2322: Type 'Editor' is not assignable to type 'ReactEditor'. * revert * generic type * generic type * generic type * extends Editor * extends Editor * infer * infer
This commit is contained in:
committed by
Ian Storm Taylor
parent
e1f4ff1f6c
commit
101661ee27
@@ -9,8 +9,8 @@ import { EDITOR_TO_ON_CHANGE, NODE_TO_KEY } from '../utils/weak-maps'
|
||||
* `withReact` adds React and DOM specific behaviors to the editor.
|
||||
*/
|
||||
|
||||
export const withReact = (editor: Editor): ReactEditor => {
|
||||
const e = editor as ReactEditor
|
||||
export const withReact = <T extends Editor>(editor: T) => {
|
||||
const e = editor as T & ReactEditor
|
||||
const { apply, onChange } = e
|
||||
|
||||
e.apply = (op: Operation) => {
|
||||
|
Reference in New Issue
Block a user