react-notion-x
react-notion-x copied to clipboard
fix: Fix collection list view hydration (remove invalid <a> tag nesting)
trafficstars
Description
react-notion-x, when rendering a CollectionViewList row, in the Collection component, nests two <a> tags within each other, which is invalid HTML (fixes #492).
When used with a next.js project, this causes a hydration error (fixes #410).
This PR makes the following changes to fix this:
linkToTitlePageon thePropertycomponent used in aCollectionViewListis set tofalseto prevent a nested<a>tag in the row's root element.- With the non-nesting occurring,
.notion-list-item-titleis updated to have atext-decoration: underlineto match.notion-link. Some new CSS variables are added to support this. .notion-list-item-propertyis updated to vertically align it's content, as it is in Notion.- Some CSS formatting is fixed.
Notion Test Page ID
Test idea for a page with a Collection List View is here: 0260a95744a64f4ca67456420761be24
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated (UTC) |
|---|---|---|---|
| react-notion-x | ✅ Ready (Inspect) | Visit Preview | Jul 9, 2023 6:31am |
| react-notion-x-minimal-demo | ✅ Ready (Inspect) | Visit Preview | Jul 9, 2023 6:31am |
@transitive-bullshit