Skip to content

useBaseUrl breaks Rules of Hooks in a few components #723

Description

@Anshumancanrock

useBaseUrl is a React hook, but a few spots call it inside conditionals, .map(), or after an early return:

  • src/pages/index.js : inside ecosystem / vendor maps
  • src/pages/case-studies.js : inside caseStudies.map
  • src/theme/BlogPostItem/Header/index.js : only when cover is set
  • src/theme/Footer/index.js : useEffect / useBaseUrl after if (!footer) return null

No ESLint in the repo (npm run lint is markdown only), so nothing catches it. Would be good to fix the call sites and add eslint-plugin-react-hooks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions