overture-stack / website

Overture.bio website, based on Gatsby static site generator
GNU Affero General Public License v3.0
1 stars 2 forks source link

Documentation page loading bug #349

Open MitchellShiell opened 8 months ago

MitchellShiell commented 8 months ago

Some documentation pages fail to load when clicking between them from the documentation dropdown.

When running locally, you get this error:

15048 |   if (!!didRenderTooFewHooks) {
  15049 |     {
> 15050 |       throw Error( "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." );
  15051 |     }
  15052 |   }
  15053 | (edited) 

Working Solution

I've isolated the error to the SectionTableofContents component more details in the following PR link. https://github.com/overture-stack/website/compare/develop...overture-docs-megamenu-fix Do not use this fix, it introduces some new bugs, however this demonstrates that the issue stems from this component, particularly the useState nested within the if statment