Skip to content

Commit 2abaf3e

Browse files
[core] Simplify anchor link
1 parent d98ff12 commit 2abaf3e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

docs/src/modules/components/AppTableOfContents.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { styled } from '@mui/material/styles';
66
import Typography from '@mui/material/Typography';
77
import NoSsr from '@mui/material/NoSsr';
88
import Link from 'docs/src/modules/components/Link';
9-
import PageContext from 'docs/src/modules/components/PageContext';
109
import { useTranslate } from 'docs/src/modules/utils/i18n';
1110
import TableOfContentsBanner from 'docs/src/components/banner/TableOfContentsBanner';
1211

@@ -119,8 +118,6 @@ export default function AppTableOfContents(props) {
119118
const t = useTranslate();
120119

121120
const items = React.useMemo(() => flatten(toc), [toc]);
122-
123-
const { activePage } = React.useContext(PageContext);
124121
const [activeState, setActiveState] = React.useState(null);
125122
const clickedRef = React.useRef(false);
126123
const unsetClickedRef = React.useRef(null);
@@ -199,7 +196,7 @@ export default function AppTableOfContents(props) {
199196
const itemLink = (item, secondary) => (
200197
<NavItem
201198
display="block"
202-
href={`${activePage?.linkProps?.linkAs ?? activePage?.pathname}#${item.hash}`}
199+
href={`#${item.hash}`}
203200
underline="none"
204201
onClick={handleClick(item.hash)}
205202
active={activeState === item.hash}

0 commit comments

Comments
 (0)