fix: hoist useBaseUrl calls to follow Rules of Hooks - #724
fix: hoist useBaseUrl calls to follow Rules of Hooks#724Anshumancanrock wants to merge 1 commit into
useBaseUrl calls to follow Rules of Hooks#724Conversation
Signed-off-by: anshumancanrock <anshu.1239.as@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Anshumancanrock The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
✅ Deploy Preview for project-hami ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe change replaces conditional or repeated ChangesURL resolution and hook consistency
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What type of PR is this?
/kind bug
What this PR does / why we need it:
useBaseUrlis a React hook, but we were calling it inside.map()s, conditionals, and after an early return in Footer. It's against the Rules of Hooks and will blow up if that data becomes conditional.Fix: use
useBaseUrlUtils()/ hoist the hook calls to the top level.Which issue(s) this PR fixes:
Fixes #723
Checklist:
npm run lintandnpm run format:checkpassnpm run buildsucceeds for bothenandzhgit commit -s)Summary by CodeRabbit