react-notion-x
react-notion-x copied to clipboard
Synced blocks not displaying in different pages
Hello!
I'm having some doubts about the synced block support.
In the demo the blocks appear to work as intended and they do if the original block and the clones are in the same page.
But if I create the block in page A:
And have the synced block in page B this is what I can see:

This seems to be the case also with file links, they are in the page and visible but no longer take you to their destination.
Please, do let me know if there is something wrong with my use of the library or if it's a known problem. Have a great day!
CMIIW but this has the same root cause as #44 - which is either:
- the blocks we want to render are not really child of current page, thus the block content won't be available during rendering time; or
- there are some bugs in the logic of determining children blocks of a page.
Haven't got time to investigate this myself unfortunately. I need this and #44 to work as well.
I agree that the issue is likely how we resolve which blocks to load up front. We support the 95% use case really well, but there are always blocks (and version of different block types) which aren't handled properly.
Notion's renderer uses a client-side API call to load additional blocks on-the-fly, which is definitely possible w/ react-notion-x, but it isn't handled out of the box just yet.
Ideally, if NotionRenderer encounters a block it doesn't have pre-loaded, it would make a call to the backend to load it like Notion does. This is also how we'd support larger collections.
If anyone wants to investigate, PRs are welcome.