From 5267f07175b8b4a6d828d604920b65680d24c9e4 Mon Sep 17 00:00:00 2001 From: Jacob Date: Mon, 1 Mar 2021 12:00:33 +0800 Subject: [PATCH] fix: fix 404 status of iframe example page (#4092) --- site/examples/{iframe.js => iframe.tsx} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename site/examples/{iframe.js => iframe.tsx} (95%) diff --git a/site/examples/iframe.js b/site/examples/iframe.tsx similarity index 95% rename from site/examples/iframe.js rename to site/examples/iframe.tsx index 9dba151d5..3171f33d2 100644 --- a/site/examples/iframe.js +++ b/site/examples/iframe.tsx @@ -2,7 +2,7 @@ import React, { useCallback, useMemo, useState } from 'react' import { createPortal } from 'react-dom' import isHotkey from 'is-hotkey' import { Editable, withReact, useSlate, Slate, ReactEditor } from 'slate-react' -import { Editor, createEditor } from 'slate' +import { Editor, createEditor, Node } from 'slate' import { withHistory } from 'slate-history' import { Button, Icon, Toolbar } from '../components' @@ -15,7 +15,7 @@ const HOTKEYS = { } const IFrameExample = () => { - const [value, setValue] = useState(initialValue) + const [value, setValue] = useState(initialValue) const renderElement = useCallback( ({ attributes, children }) =>

{children}

, [] @@ -42,7 +42,7 @@ const IFrameExample = () => { autoFocus onKeyDown={event => { for (const hotkey in HOTKEYS) { - if (isHotkey(hotkey, event)) { + if (isHotkey(hotkey, event as any)) { event.preventDefault() const mark = HOTKEYS[hotkey] toggleMark(editor, mark)