diff --git a/core/src/Editor.nohighlight.tsx b/core/src/Editor.nohighlight.tsx index a678412c8..3086d3726 100644 --- a/core/src/Editor.nohighlight.tsx +++ b/core/src/Editor.nohighlight.tsx @@ -136,7 +136,7 @@ const InternalMDEditor = React.forwardRef( [props.extraCommands], ); - const textareaDomRef = useRef(undefined); + const textareaDomRef = useRef(); const active = useRef<'text' | 'preview'>('preview'); const initScroll = useRef(false); diff --git a/core/src/Editor.tsx b/core/src/Editor.tsx index 79b403dc6..831d93835 100644 --- a/core/src/Editor.tsx +++ b/core/src/Editor.tsx @@ -136,7 +136,7 @@ const InternalMDEditor = React.forwardRef( [props.extraCommands], ); - const textareaDomRef = useRef(undefined); + const textareaDomRef = useRef(); const active = useRef<'text' | 'preview'>('preview'); const initScroll = useRef(false); diff --git a/core/src/components/DragBar/index.tsx b/core/src/components/DragBar/index.tsx index 9acaabf3e..5d64cc03a 100644 --- a/core/src/components/DragBar/index.tsx +++ b/core/src/components/DragBar/index.tsx @@ -12,7 +12,7 @@ export interface IDragBarProps extends IProps { const DragBar: React.FC = (props) => { const { prefixCls, onChange } = props || {}; const $dom = useRef(null); - const dragRef = useRef<{ height: number; dragY: number }>(undefined); + const dragRef = useRef<{ height: number; dragY: number }>(); const heightRef = useRef(props.height); useEffect(() => { diff --git a/core/src/components/TextArea/Textarea.tsx b/core/src/components/TextArea/Textarea.tsx index b9f502119..eefb41586 100644 --- a/core/src/components/TextArea/Textarea.tsx +++ b/core/src/components/TextArea/Textarea.tsx @@ -23,7 +23,7 @@ export default function Textarea(props: TextAreaProps) { ...otherStore } = useContext(EditorContext); const textRef = React.useRef(null); - const executeRef = React.useRef(undefined); + const executeRef = React.useRef(); const statesRef = React.useRef({ fullscreen, preview }); useEffect(() => { diff --git a/core/src/components/TextArea/index.nohighlight.tsx b/core/src/components/TextArea/index.nohighlight.tsx index 8daa9b159..c2044a636 100644 --- a/core/src/components/TextArea/index.nohighlight.tsx +++ b/core/src/components/TextArea/index.nohighlight.tsx @@ -43,7 +43,7 @@ export default function TextArea(props: ITextAreaProps) { const { prefixCls, className, onScroll, renderTextarea, ...otherProps } = props || {}; const { markdown, scrollTop, commands, extraCommands, dispatch } = useContext(EditorContext); const textRef = React.useRef(null); - const executeRef = React.useRef(undefined); + const executeRef = React.useRef(); const warp = React.createRef(); useEffect(() => { const state: ContextStore = {}; diff --git a/core/src/components/TextArea/index.tsx b/core/src/components/TextArea/index.tsx index a48d2c04f..1600006c0 100644 --- a/core/src/components/TextArea/index.tsx +++ b/core/src/components/TextArea/index.tsx @@ -45,7 +45,7 @@ export default function TextArea(props: ITextAreaProps) { const { markdown, scrollTop, commands, minHeight, highlightEnable, extraCommands, dispatch } = useContext(EditorContext); const textRef = React.useRef(null); - const executeRef = React.useRef(undefined); + const executeRef = React.useRef(); const warp = React.createRef(); useEffect(() => { const state: ContextStore = {};