From 0434182166242ce4314a0a38597a5966c756324c Mon Sep 17 00:00:00 2001 From: Sunny Hirai Date: Mon, 29 Mar 2021 01:01:25 -0700 Subject: [PATCH] Added comments to with-history and with-react to help fix TypeScript errors --- packages/slate-history/src/with-history.ts | 5 +++++ packages/slate-react/src/plugin/with-react.ts | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/packages/slate-history/src/with-history.ts b/packages/slate-history/src/with-history.ts index 734547252..e331aaaad 100644 --- a/packages/slate-history/src/with-history.ts +++ b/packages/slate-history/src/with-history.ts @@ -5,6 +5,11 @@ import { HistoryEditor } from './history-editor' /** * The `withHistory` plugin keeps track of the operation history of a Slate * editor as operations are applied to it, using undo and redo stacks. + * + * If you are using TypeScript, you must extend Slate's CustomTypes to use + * this plugin. + * + * See https://docs.slatejs.org/concepts/11-typescript to learn how. */ export const withHistory = (editor: T) => { diff --git a/packages/slate-react/src/plugin/with-react.ts b/packages/slate-react/src/plugin/with-react.ts index f29f4255c..712d6acc4 100644 --- a/packages/slate-react/src/plugin/with-react.ts +++ b/packages/slate-react/src/plugin/with-react.ts @@ -8,6 +8,11 @@ import { isDOMText, getPlainText } from '../utils/dom' /** * `withReact` adds React and DOM specific behaviors to the editor. + * + * If you are using TypeScript, you must extend Slate's CustomTypes to use + * this plugin. + * + * See https://docs.slatejs.org/concepts/11-typescript to learn how. */ export const withReact = (editor: T) => {