From 3ca2f1e14f290acf87ea124bb2b91780d652cb90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Thu, 23 May 2019 23:46:03 +0800 Subject: [PATCH] rm get tabkey from props --- AccountCenter/src/index.tsx | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/AccountCenter/src/index.tsx b/AccountCenter/src/index.tsx index c0c74928..08e0a355 100644 --- a/AccountCenter/src/index.tsx +++ b/AccountCenter/src/index.tsx @@ -66,23 +66,23 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent< BLOCK_NAME_CAMEL_CASEProps, BLOCK_NAME_CAMEL_CASEState > { - static getDerivedStateFromProps( - props: BLOCK_NAME_CAMEL_CASEProps, - state: BLOCK_NAME_CAMEL_CASEState, - ) { - const { match, location } = props; - const { tabKey } = state; - const path = match && match.path; + // static getDerivedStateFromProps( + // props: BLOCK_NAME_CAMEL_CASEProps, + // state: BLOCK_NAME_CAMEL_CASEState, + // ) { + // const { match, location } = props; + // const { tabKey } = state; + // const path = match && match.path; - const urlTabKey = location.pathname.replace(`${path}/`, ''); - if (urlTabKey && urlTabKey !== '/' && tabKey !== urlTabKey) { - return { - tabKey: urlTabKey, - }; - } + // const urlTabKey = location.pathname.replace(`${path}/`, ''); + // if (urlTabKey && urlTabKey !== '/' && tabKey !== urlTabKey) { + // return { + // tabKey: urlTabKey, + // }; + // } - return null; - } + // return null; + // } state: BLOCK_NAME_CAMEL_CASEState = { newTags: [], -- GitLab