We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e889610 commit 272d70aCopy full SHA for 272d70a
docs/react_components/Anchor.js
@@ -1,5 +1,6 @@
1
import useBrokenLinks from "@docusaurus/useBrokenLinks";
2
import {useLocation} from "@docusaurus/router";
3
+import { useEffect } from 'react';
4
5
6
export function Anchor({
@@ -30,6 +31,12 @@ export function Anchor({
30
31
// https://github.com/vercel/next.js/issues/51346. The workarounds there are
32
// for next.js, not plain React. It may have something to do with `pushState`
33
if ( do_highlight && hash === "#" + id ) {
34
+
35
+ useEffect(()=>{
36
+ const this_element = document.getElementById( id );
37
+ this_element.scrollIntoView();
38
+ }, []);
39
40
return (
41
<mark
42
id={ id }
0 commit comments