From 6ad68f687ff95572bf3a0e8641dff06a2299908e Mon Sep 17 00:00:00 2001 From: shfshanyue Date: Thu, 22 Apr 2021 16:42:02 +0800 Subject: [PATCH] Named Component name --- src/components/workspace/Button.tsx | 2 +- src/components/workspace/Editor.tsx | 2 +- src/components/workspace/Inspector.tsx | 2 +- src/components/workspace/PlayerFrame.tsx | 2 +- src/components/workspace/Workspace.tsx | 2 +- src/components/workspace/panes/PlayerPane.tsx | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/workspace/Button.tsx b/src/components/workspace/Button.tsx index d60ea57..2f40677 100644 --- a/src/components/workspace/Button.tsx +++ b/src/components/workspace/Button.tsx @@ -69,7 +69,7 @@ interface State { hover: boolean } -export default class extends PureComponent { +export default class Button extends PureComponent { static defaultProps = { active: false, inverse: false, diff --git a/src/components/workspace/Editor.tsx b/src/components/workspace/Editor.tsx index 26bcaa5..3d6075f 100644 --- a/src/components/workspace/Editor.tsx +++ b/src/components/workspace/Editor.tsx @@ -67,7 +67,7 @@ export interface Props { errorLineNumber?: number } -export default class extends PureComponent { +export default class Editor extends PureComponent { static defaultProps = { initialValue: null, value: null, diff --git a/src/components/workspace/Inspector.tsx b/src/components/workspace/Inspector.tsx index 5d195b8..6ecfbd6 100644 --- a/src/components/workspace/Inspector.tsx +++ b/src/components/workspace/Inspector.tsx @@ -27,7 +27,7 @@ export const Inspector = Loadable({ import('react-inspector').then(({ default: Inspector, chromeLight }) => { const theme = createInspectorTheme(chromeLight) - return (props: InspectorProps) => + return function LazyInspector(props: InspectorProps) { return } }), loading: () => null, }) diff --git a/src/components/workspace/PlayerFrame.tsx b/src/components/workspace/PlayerFrame.tsx index 53e3c04..1374f21 100644 --- a/src/components/workspace/PlayerFrame.tsx +++ b/src/components/workspace/PlayerFrame.tsx @@ -40,7 +40,7 @@ interface State { id: string | null } -export default class extends PureComponent { +export default class PlayerFrame extends PureComponent { static defaultProps = { preset: 'react-native', platform: 'ios', diff --git a/src/components/workspace/Workspace.tsx b/src/components/workspace/Workspace.tsx index ad05948..aa94294 100644 --- a/src/components/workspace/Workspace.tsx +++ b/src/components/workspace/Workspace.tsx @@ -184,7 +184,7 @@ type WorkspacePaneProps = { renderPane: (options: PaneOptions, index: number) => ReactNode } -const WorkspacePane = memo((props: WorkspacePaneProps) => { +const WorkspacePane = memo(function WorkspacePane (props: WorkspacePaneProps) { const { environmentName: environmentName, ready, diff --git a/src/components/workspace/panes/PlayerPane.tsx b/src/components/workspace/panes/PlayerPane.tsx index 8762726..14a4d50 100644 --- a/src/components/workspace/panes/PlayerPane.tsx +++ b/src/components/workspace/panes/PlayerPane.tsx @@ -41,7 +41,7 @@ export interface Props { } const PlayerPane = memo( - React.forwardRef(function renderPlayer( + React.forwardRef(function PlayerPane( { options, externalStyles,