提交 cf99cd60 编写于 作者: B Boris Sekachev

using DidMount instead of DidUpdate

上级 b89ea584
......@@ -42,7 +42,7 @@ export default function ProjectListComponent(): JSX.Element {
<Col className='cvat-projects-list' md={22} lg={18} xl={16} xxl={14}>
{projectInstances.map(
(row: any[]): JSX.Element => (
<Row gutter={[8, 8]}>
<Row key={row[0].id} gutter={[8, 8]}>
{row.map((instance: any) => (
<Col span={6} key={instance.id}>
<ProjectItem projectInstance={instance} />
......
......@@ -28,14 +28,16 @@ interface TaskPageComponentProps {
type Props = TaskPageComponentProps & RouteComponentProps<{ id: string }>;
class TaskPageComponent extends React.PureComponent<Props> {
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');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册