Skip to content

Commit 837d54a

Browse files
authored
Merge pull request #72 from 01-binary/issue#71
fix: Update link property type and access nested url property for tex…
2 parents 8b7f6f1 + d8002d1 commit 837d54a

File tree

1 file changed

+6
-3
lines changed
  • packages/notion-to-jsx/src/components/Renderer/components/RichText

1 file changed

+6
-3
lines changed

packages/notion-to-jsx/src/components/Renderer/components/RichText/RichTexts.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ export interface RichTextItem {
4444

4545
text?: {
4646
content: string;
47-
link: string | null;
47+
link: {
48+
url: string | null;
49+
} | null;
4850
};
4951
}
5052

@@ -76,8 +78,9 @@ const RichTexts: React.FC<RichTextProps> = ({ richTexts }) => {
7678
case 'text': {
7779
if (text.text) {
7880
const { text: textData } = text;
79-
content = textData.link
80-
? renderLink(textData.link, textData.content)
81+
82+
content = textData.link?.url
83+
? renderLink(textData.link.url, textData.content)
8184
: textData.content;
8285
} else {
8386
content = text.plain_text;

0 commit comments

Comments
 (0)