1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-16 20:24:01 +02:00

Revert "Revert "TypeScript Improvement: Use [key: string]: unknown, not [key: string]: any (#3565)""

This reverts commit 81d2f9bb8f.
This commit is contained in:
CameronAckermanSEL
2020-05-04 17:38:14 -07:00
parent 036ee664af
commit d82ffe49a5
17 changed files with 42 additions and 38 deletions

View File

@@ -708,7 +708,7 @@ export const Editable = (props: EditableProps) => {
if (Hotkeys.isRedo(nativeEvent)) {
event.preventDefault()
if (editor.redo) {
if (typeof editor.redo === 'function') {
editor.redo()
}
@@ -718,7 +718,7 @@ export const Editable = (props: EditableProps) => {
if (Hotkeys.isUndo(nativeEvent)) {
event.preventDefault()
if (editor.undo) {
if (typeof editor.undo === 'function') {
editor.undo()
}

View File

@@ -43,7 +43,7 @@ const Leaf = (props: {
opacity: '0.333',
}}
>
{leaf.placeholder}
{leaf.placeholder as React.ReactNode}
</span>
{children}
</React.Fragment>

View File

@@ -17,7 +17,7 @@ export const Slate = (props: {
value: Node[]
children: React.ReactNode
onChange: (value: Node[]) => void
[key: string]: any
[key: string]: unknown
}) => {
const { editor, children, onChange, value, ...rest } = props
const [key, setKey] = useState(0)