diff --git a/app/components/Editor.tsx b/app/components/Editor.tsx index b16571c70..67f86a73d 100644 --- a/app/components/Editor.tsx +++ b/app/components/Editor.tsx @@ -178,8 +178,8 @@ function Editor(props: Props, ref: React.RefObject | null) { ); const focusAtEnd = React.useCallback(() => { - ref?.current?.focusAtEnd(); - }, [ref]); + localRef?.current?.focusAtEnd(); + }, [localRef]); const handleDrop = React.useCallback( (event: React.DragEvent) => { @@ -187,7 +187,7 @@ function Editor(props: Props, ref: React.RefObject | null) { event.stopPropagation(); const files = getDataTransferFiles(event); - const view = ref?.current?.view; + const view = localRef?.current?.view; if (!view) { return; } @@ -231,7 +231,7 @@ function Editor(props: Props, ref: React.RefObject | null) { }); }, [ - ref, + localRef, props.onFileUploadStart, props.onFileUploadStop, dictionary,