Skip to content

Commit

Permalink
type: fix type error. (#676) #665
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Dec 18, 2024
1 parent 196eeac commit 763e2dc
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/src/Editor.nohighlight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const InternalMDEditor = React.forwardRef<RefMDEditor, MDEditorProps>(
[props.extraCommands],
);

const textareaDomRef = useRef<HTMLDivElement>(undefined);
const textareaDomRef = useRef<HTMLDivElement>();
const active = useRef<'text' | 'preview'>('preview');
const initScroll = useRef(false);

Expand Down
2 changes: 1 addition & 1 deletion core/src/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const InternalMDEditor = React.forwardRef<RefMDEditor, MDEditorProps>(
[props.extraCommands],
);

const textareaDomRef = useRef<HTMLDivElement>(undefined);
const textareaDomRef = useRef<HTMLDivElement>();
const active = useRef<'text' | 'preview'>('preview');
const initScroll = useRef(false);

Expand Down
2 changes: 1 addition & 1 deletion core/src/components/DragBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface IDragBarProps extends IProps {
const DragBar: React.FC<IDragBarProps> = (props) => {
const { prefixCls, onChange } = props || {};
const $dom = useRef<HTMLDivElement>(null);
const dragRef = useRef<{ height: number; dragY: number }>(undefined);
const dragRef = useRef<{ height: number; dragY: number }>();
const heightRef = useRef(props.height);

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/TextArea/Textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function Textarea(props: TextAreaProps) {
...otherStore
} = useContext(EditorContext);
const textRef = React.useRef<HTMLTextAreaElement>(null);
const executeRef = React.useRef<TextAreaCommandOrchestrator>(undefined);
const executeRef = React.useRef<TextAreaCommandOrchestrator>();
const statesRef = React.useRef<ExecuteCommandState>({ fullscreen, preview });

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/TextArea/index.nohighlight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLTextAreaElement>(null);
const executeRef = React.useRef<TextAreaCommandOrchestrator>(undefined);
const executeRef = React.useRef<TextAreaCommandOrchestrator>();
const warp = React.createRef<HTMLDivElement>();
useEffect(() => {
const state: ContextStore = {};
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/TextArea/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function TextArea(props: ITextAreaProps) {
const { markdown, scrollTop, commands, minHeight, highlightEnable, extraCommands, dispatch } =
useContext(EditorContext);
const textRef = React.useRef<HTMLTextAreaElement>(null);
const executeRef = React.useRef<TextAreaCommandOrchestrator>(undefined);
const executeRef = React.useRef<TextAreaCommandOrchestrator>();
const warp = React.createRef<HTMLDivElement>();
useEffect(() => {
const state: ContextStore = {};
Expand Down

0 comments on commit 763e2dc

Please sign in to comment.