diff --git a/.changeset/docs-contguidelines.md b/.changeset/docs-contguidelines.md new file mode 100644 index 000000000..8358313b1 --- /dev/null +++ b/.changeset/docs-contguidelines.md @@ -0,0 +1,5 @@ +--- +'react-magma-docs': patch +--- + +docs: Fix contribution guidelines page \ No newline at end of file diff --git a/website/react-magma-docs/src/components/SubPageTabs/index.js b/website/react-magma-docs/src/components/SubPageTabs/index.js index 7cf0716d9..6c975b74c 100644 --- a/website/react-magma-docs/src/components/SubPageTabs/index.js +++ b/website/react-magma-docs/src/components/SubPageTabs/index.js @@ -103,7 +103,7 @@ export const SubPageTabs = ({ pageData, hasHorizontalNav }) => { entries => { entries.forEach(entry => { if (entry.isIntersecting) { - const index = headings.findIndex( + const index = headings?.findIndex( page => convertTextToId(page) === entry.target.id ); @@ -114,7 +114,7 @@ export const SubPageTabs = ({ pageData, hasHorizontalNav }) => { { rootMargin: rootMarginValue } ); - headings.forEach(page => { + headings?.forEach(page => { const id = convertTextToId(page); const element = document.getElementById(id); @@ -124,7 +124,7 @@ export const SubPageTabs = ({ pageData, hasHorizontalNav }) => { }); return () => { - headings.forEach(page => { + headings?.forEach(page => { const id = convertTextToId(page); const element = document.getElementById(id); @@ -133,7 +133,7 @@ export const SubPageTabs = ({ pageData, hasHorizontalNav }) => { } }); }; - }, []); + }, [headings]); return ( <>