fix: resolve hydration error caused by nested interactive elements#493
fix: resolve hydration error caused by nested interactive elements#493prathik-05 wants to merge 1 commit into
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
👋 Thanks for opening a PR, @prathik-05!Your PR has entered the 🚦 PR Review Pipeline.
What happens next
A pipeline status comment will appear below and update automatically as your PR progresses. While you wait
This comment is posted only once. |
|
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 (1)
WalkthroughThe PR composes the dashboard "Create new playground" action with ChangesUI composition and accessibility
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed due to a network error. 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 |
d97d7d5 to
3564594
Compare
Summary
What changed: Added the
asChildprop to theSidebarGroupActioncomponent that wraps theLinknavigating to the/dashboardroute.Why it changed: By default,
SidebarGroupActionrenders as a native<button>. This caused the Next.jsLinkcomponent (<a>) to be nested inside a<button>, resulting in invalid HTML semantics (<a>cannot appear as a descendant of<button>) and triggering hydration warnings/errors on the dashboard/profile pages. UsingasChilddelegates rendering responsibility to the childLink, eliminating the invalid nesting while preserving the existing behavior, styling, and accessibility.Type of Change
Related Issue
Closes #423
Validation
npm run build— Verified that the Next.js production build completes successfully.npm test— Verified that all 81 tests across 9 test files pass successfully.npm run lint— Not executed locally. (Mark this as completed only if you actually ran it.)Additional Manual Verification
asChildprop delegates rendering responsibility to the childLinkcomponent, eliminating the invalid<button>→<a>nesting.<a> cannot appear as a descendant of <button>) no longer appears in the browser console./dashboardcontinues to work correctly.Screenshots or Recordings
N/A — This change resolves an underlying HTML semantics and hydration issue without introducing visible UI changes.
Checklist
Summary by CodeRabbit
Refactor
Style