From cf99cd6086c852b851ae23c4b0227099416d63cd Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Wed, 9 Dec 2020 11:21:28 +0300 Subject: [PATCH] using DidMount instead of DidUpdate --- cvat-ui/src/components/projects-page/project-list.tsx | 2 +- cvat-ui/src/components/task-page/task-page.tsx | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cvat-ui/src/components/projects-page/project-list.tsx b/cvat-ui/src/components/projects-page/project-list.tsx index 134286be..431f5da7 100644 --- a/cvat-ui/src/components/projects-page/project-list.tsx +++ b/cvat-ui/src/components/projects-page/project-list.tsx @@ -42,7 +42,7 @@ export default function ProjectListComponent(): JSX.Element { {projectInstances.map( (row: any[]): JSX.Element => ( - + {row.map((instance: any) => ( diff --git a/cvat-ui/src/components/task-page/task-page.tsx b/cvat-ui/src/components/task-page/task-page.tsx index ac440600..7537ce5a 100644 --- a/cvat-ui/src/components/task-page/task-page.tsx +++ b/cvat-ui/src/components/task-page/task-page.tsx @@ -28,14 +28,16 @@ interface TaskPageComponentProps { type Props = TaskPageComponentProps & RouteComponentProps<{ id: string }>; class TaskPageComponent extends React.PureComponent { - public componentDidUpdate(): void { - const { - deleteActivity, history, task, fetching, getTask, - } = this.props; + public componentDidMount(): void { + const { task, fetching, getTask } = this.props; if (task === null && !fetching) { getTask(); } + } + + public componentDidUpdate(): void { + const { deleteActivity, history } = this.props; if (deleteActivity) { history.replace('/tasks');