Skip to content

Commit 763e2dc

Browse files
committed
type: fix type error. (#676) #665
1 parent 196eeac commit 763e2dc

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

core/src/Editor.nohighlight.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ const InternalMDEditor = React.forwardRef<RefMDEditor, MDEditorProps>(
136136
[props.extraCommands],
137137
);
138138

139-
const textareaDomRef = useRef<HTMLDivElement>(undefined);
139+
const textareaDomRef = useRef<HTMLDivElement>();
140140
const active = useRef<'text' | 'preview'>('preview');
141141
const initScroll = useRef(false);
142142

core/src/Editor.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ const InternalMDEditor = React.forwardRef<RefMDEditor, MDEditorProps>(
136136
[props.extraCommands],
137137
);
138138

139-
const textareaDomRef = useRef<HTMLDivElement>(undefined);
139+
const textareaDomRef = useRef<HTMLDivElement>();
140140
const active = useRef<'text' | 'preview'>('preview');
141141
const initScroll = useRef(false);
142142

core/src/components/DragBar/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export interface IDragBarProps extends IProps {
1212
const DragBar: React.FC<IDragBarProps> = (props) => {
1313
const { prefixCls, onChange } = props || {};
1414
const $dom = useRef<HTMLDivElement>(null);
15-
const dragRef = useRef<{ height: number; dragY: number }>(undefined);
15+
const dragRef = useRef<{ height: number; dragY: number }>();
1616
const heightRef = useRef(props.height);
1717

1818
useEffect(() => {

core/src/components/TextArea/Textarea.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default function Textarea(props: TextAreaProps) {
2323
...otherStore
2424
} = useContext(EditorContext);
2525
const textRef = React.useRef<HTMLTextAreaElement>(null);
26-
const executeRef = React.useRef<TextAreaCommandOrchestrator>(undefined);
26+
const executeRef = React.useRef<TextAreaCommandOrchestrator>();
2727
const statesRef = React.useRef<ExecuteCommandState>({ fullscreen, preview });
2828

2929
useEffect(() => {

core/src/components/TextArea/index.nohighlight.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default function TextArea(props: ITextAreaProps) {
4343
const { prefixCls, className, onScroll, renderTextarea, ...otherProps } = props || {};
4444
const { markdown, scrollTop, commands, extraCommands, dispatch } = useContext(EditorContext);
4545
const textRef = React.useRef<HTMLTextAreaElement>(null);
46-
const executeRef = React.useRef<TextAreaCommandOrchestrator>(undefined);
46+
const executeRef = React.useRef<TextAreaCommandOrchestrator>();
4747
const warp = React.createRef<HTMLDivElement>();
4848
useEffect(() => {
4949
const state: ContextStore = {};

core/src/components/TextArea/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default function TextArea(props: ITextAreaProps) {
4545
const { markdown, scrollTop, commands, minHeight, highlightEnable, extraCommands, dispatch } =
4646
useContext(EditorContext);
4747
const textRef = React.useRef<HTMLTextAreaElement>(null);
48-
const executeRef = React.useRef<TextAreaCommandOrchestrator>(undefined);
48+
const executeRef = React.useRef<TextAreaCommandOrchestrator>();
4949
const warp = React.createRef<HTMLDivElement>();
5050
useEffect(() => {
5151
const state: ContextStore = {};

0 commit comments

Comments
 (0)