NotionX / NotionX/react-notion-x

User @mentions don't render when coming through the notion integration API

Open
#361 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5.4k
Forks
645
PR merge metrics
No merged PRs in 30d

Description

Description

We are using the compat transformer with the new Notion API to embed private Notion docs. The API is not returning the user data, so instead of the block trying to render the username (which is available on the block) it renders nothing in place of these private user @mentions.

I believe it is this line here that is short circuiting:
https://github.com/NotionX/react-notion-x/blob/cfbfcc15145d9ece96d2fa526b5c4f8305576c99/packages/react-notion-x/src/components/text.tsx#L69

Sample data

Screen Shot 2022-09-01 at 8 58 50 AM

Sample output
Screen Shot 2022-09-01 at 9 01 05 AM

Notion Test Page ID

The problem is inherently related to private pages.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at packages/react-notion-x/src/components/text.tsx, especially the linked line around the mention rendering logic, and inspect how the compat transformer represents private user mentions from the Notion API. Done means a private-page @mention renders the username available on its block instead of an empty result; no test file is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
api, frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.