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<
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: [],
......
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