Commit 3ca2f1e1 authored by 陈帅's avatar 陈帅

rm get tabkey from props

parent 8c52c611
...@@ -66,23 +66,23 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent< ...@@ -66,23 +66,23 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent<
BLOCK_NAME_CAMEL_CASEProps, BLOCK_NAME_CAMEL_CASEProps,
BLOCK_NAME_CAMEL_CASEState BLOCK_NAME_CAMEL_CASEState
> { > {
static getDerivedStateFromProps( // static getDerivedStateFromProps(
props: BLOCK_NAME_CAMEL_CASEProps, // props: BLOCK_NAME_CAMEL_CASEProps,
state: BLOCK_NAME_CAMEL_CASEState, // state: BLOCK_NAME_CAMEL_CASEState,
) { // ) {
const { match, location } = props; // const { match, location } = props;
const { tabKey } = state; // const { tabKey } = state;
const path = match && match.path; // const path = match && match.path;
const urlTabKey = location.pathname.replace(`${path}/`, ''); // const urlTabKey = location.pathname.replace(`${path}/`, '');
if (urlTabKey && urlTabKey !== '/' && tabKey !== urlTabKey) { // if (urlTabKey && urlTabKey !== '/' && tabKey !== urlTabKey) {
return { // return {
tabKey: urlTabKey, // tabKey: urlTabKey,
}; // };
} // }
return null; // return null;
} // }
state: BLOCK_NAME_CAMEL_CASEState = { state: BLOCK_NAME_CAMEL_CASEState = {
newTags: [], newTags: [],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment