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:
@@ -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()
|
||||
}
|
||||
|
||||
|
@@ -43,7 +43,7 @@ const Leaf = (props: {
|
||||
opacity: '0.333',
|
||||
}}
|
||||
>
|
||||
{leaf.placeholder}
|
||||
{leaf.placeholder as React.ReactNode}
|
||||
</span>
|
||||
{children}
|
||||
</React.Fragment>
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user