Skip to content

Hydration error warning caused by nested hyperlink HTML elements.#919

Open
thedunncodes wants to merge 2 commits intofedora-infra:swatantryafrom
thedunncodes:hydration_error0
Open

Hydration error warning caused by nested hyperlink HTML elements.#919
thedunncodes wants to merge 2 commits intofedora-infra:swatantryafrom
thedunncodes:hydration_error0

Conversation

@thedunncodes
Copy link
Copy Markdown

Summary

  • Hydration error warning pops up every time the home page is loaded, This is caused by nesting an hyperlink element e.g <a> in another. Many reusable components in the modern packages often have different components implementing an HTML hyperlink element in them. When these components are not used properly it could result into an hydration error.

  • In the tahrir project, this error occurs at tahrir/frontend/src/routes/homepage.jsx where we have a <Link> component nested under a <VertItem> component which also contains a <Link> component.

Fixes #903

Changes

  • The <VertItem> component has been provisioned with an onClick option which can be used in place of the link option in this case.

  • I created a handleAwardsClicks function to satisy the onClick event in the <VertItem> component. Within the function, navigation is properly handled by the useNavigation hook from react router.

Screenshot From 2026-04-01 04-14-01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant