NotionX / react-notion-x

Fast and accurate React renderer for Notion. TS batteries included. ⚡️
https://react-notion-x-demo.transitivebullsh.it
MIT License
4.69k stars 544 forks source link

fix: Fix collection list view hydration (remove invalid <a> tag nesting) #506

Open ryngonzalez opened 1 year ago

ryngonzalez commented 1 year ago

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).

Screenshot 2023-07-09 at 1 34 18 PM

When used with a next.js project, this causes a hydration error (fixes #410).

Screenshot 2023-07-09 at 1 33 15 PM

This PR makes the following changes to fix this:

Notion Test Page ID

Test idea for a page with a Collection List View is here: 0260a95744a64f4ca67456420761be24

vercel[bot] commented 1 year ago

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
rimonhanna commented 2 months ago

@transitive-bullshit