fix(plugin-docs): Fix TOC link makes page reload loop
MODIFY
packages/plugin-docs/src/compiler.ts
packages/plugin-docs/src/compiler.ts
@@ -38,8 +38,7 @@ function MDXContent(props = {}) {
useEffect(() => {
if (window.location.hash.length !== 0) {
const hash = window.location.hash;
- window.location.hash = '';
- window.location.hash = hash;
+ document.getElementById(hash.slice(1))?.scrollIntoView();
}
}, []);

fix(plugin-docs): Fix #644 TOC link makes page reload loop (#653)