Skip to content

Commit 375e50d

Browse files
committed
fix: react import
1 parent 39553d5 commit 375e50d

File tree

29 files changed

+136
-73
lines changed

29 files changed

+136
-73
lines changed

src/components/DropList/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { Component, type PropsWithChildren } from 'react';
1+
import React, { type PropsWithChildren } from 'react';
22

33
interface DropListProps {
44
show: boolean;
55
onClose?: () => void;
66
}
77

8-
class DropList extends Component<PropsWithChildren<DropListProps>, any> {
8+
class DropList extends React.Component<PropsWithChildren<DropListProps>, any> {
99
constructor(props: any) {
1010
super(props);
1111
this.handleClose = this.handleClose.bind(this);

src/components/Icon/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Icon
2-
import * as React from 'react';
2+
import React from 'react';
33

44
interface IconProps {
55
type: string;

src/components/NavigationBar/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as React from 'react';
1+
import type React from 'react';
22

33
interface NavigationBarProps {
44
left?: React.ReactElement[];
@@ -8,7 +8,9 @@ interface NavigationBarProps {
88

99
export default function NavigationBar(props: NavigationBarProps) {
1010
return (
11-
<div className={`rc-md-navigation ${props.visible ? 'visible' : 'in-visible'}`}>
11+
<div
12+
className={`rc-md-navigation ${props.visible ? 'visible' : 'in-visible'}`}
13+
>
1214
<div className="navigation-nav left">
1315
<div className="button-wrap">{props.left}</div>
1416
</div>

src/components/ToolBar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as React from 'react';
1+
import type React from 'react';
22

33
interface ToolBarProps {
44
style?: React.CSSProperties;

src/editor/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { nanoid } from 'nanoid';
2-
import React, { Component } from 'react';
2+
import React from 'react';
33
import Icon from '../components/Icon';
44
import NavigationBar from '../components/NavigationBar';
55
import ToolBar from '../components/ToolBar';
@@ -64,7 +64,7 @@ export interface EditorState {
6464
};
6565
}
6666

67-
class Editor<C = any> extends Component<EditorProps<C>, EditorState> {
67+
class Editor<C = any> extends React.Component<EditorProps<C>, EditorState> {
6868
private static plugins: PluginItem[] = [];
6969

7070
/**

src/editor/preview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as React from 'react';
1+
import React from 'react';
22

33
export type HtmlType = string | React.ReactElement;
44

src/plugins/Image/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as React from 'react';
1+
import React from 'react';
22
import Icon from '../../components/Icon';
33
import i18n from '../../i18n';
44
import { isPromise } from '../../utils/tool';

src/plugins/Image/inputFile.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// TableList
2-
import * as React from 'react';
2+
import React from 'react';
33

44
interface InputFileProps {
55
accept: string;

src/plugins/autoResize.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as React from 'react';
1+
import React from 'react';
22
import { PluginComponent } from './Plugin';
33

44
export default class AutoResize extends PluginComponent {
@@ -19,7 +19,9 @@ export default class AutoResize extends PluginComponent {
1919
constructor(props: any) {
2020
super(props);
2121

22-
this.useTimer = this.getConfig('useTimer') || typeof requestAnimationFrame === 'undefined';
22+
this.useTimer =
23+
this.getConfig('useTimer') ||
24+
typeof requestAnimationFrame === 'undefined';
2325

2426
this.handleChange = this.handleChange.bind(this);
2527
this.doResize = this.doResize.bind(this);
@@ -28,7 +30,10 @@ export default class AutoResize extends PluginComponent {
2830
doResize() {
2931
const resizeElement = (e: HTMLElement) => {
3032
e.style.height = 'auto';
31-
const height = Math.min(Math.max(this.getConfig('min'), e.scrollHeight), this.getConfig('max'));
33+
const height = Math.min(
34+
Math.max(this.getConfig('min'), e.scrollHeight),
35+
this.getConfig('max'),
36+
);
3237
e.style.height = `${height}px`;
3338
return height;
3439
};

src/plugins/block/code-block.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as React from 'react';
1+
import React from 'react';
22
import Icon from '../../components/Icon';
33
import i18n from '../../i18n';
44
import { PluginComponent } from '../Plugin';

0 commit comments

Comments
 (0)