File tree Expand file tree Collapse file tree 4 files changed +22
-4
lines changed Expand file tree Collapse file tree 4 files changed +22
-4
lines changed Original file line number Diff line number Diff line change 1010 "start" : " next start"
1111 },
1212 "dependencies" : {
13- "next" : " ^9.3.5 " ,
13+ "next" : " ^9.5.3 " ,
1414 "node-fetch" : " ^2.6.0" ,
1515 "react" : " ^16.13.1" ,
1616 "react-dom" : " ^16.13.1" ,
Original file line number Diff line number Diff line change 1+ import React from "react" ;
12import { NotionRenderer , BlockMapType } from "react-notion" ;
23import Head from "next/head" ;
4+ import Link from "next/link" ;
35import fetch from "node-fetch" ;
46
57export async function getServerSideProps ( context ) {
@@ -39,7 +41,15 @@ const NotionPage = ({ blockMap }) => {
3941 < Head >
4042 < title > { title } </ title >
4143 </ Head >
42- < NotionRenderer blockMap = { blockMap } fullPage />
44+ < NotionRenderer
45+ blockMap = { blockMap }
46+ fullPage
47+ customComponents = { {
48+ page : ( { blockValue, renderComponent } ) => (
49+ < Link href = { `/${ blockValue . id } ` } > { renderComponent ( ) } </ Link >
50+ )
51+ } }
52+ />
4353 < style jsx global > { `
4454 div :global(.notion-code) {
4555 box-sizing: border-box;
Original file line number Diff line number Diff line change 11import { NotionRenderer , BlockMapType } from "react-notion" ;
22import Head from "next/head" ;
3+ import Link from "next/link" ;
34import fetch from "node-fetch" ;
45
56export async function getStaticProps ( ) {
@@ -26,7 +27,14 @@ const Home = ({ blockMap }) => (
2627 < Head >
2728 < title > react-notion example</ title >
2829 </ Head >
29- < NotionRenderer blockMap = { blockMap } />
30+ < NotionRenderer
31+ blockMap = { blockMap }
32+ customComponents = { {
33+ page : ( { blockValue, renderComponent } ) => (
34+ < Link href = { `/${ blockValue . id } ` } > { renderComponent ( ) } </ Link >
35+ )
36+ } }
37+ />
3038 </ div >
3139) ;
3240
Original file line number Diff line number Diff line change @@ -3310,7 +3310,7 @@ next-tick@~1.0.0:
33103310 resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c"
33113311 integrity sha1-yobR/ogoFpsBICCOPchCS524NCw=
33123312
3313- next@^9.3.5 :
3313+ next@^9.5.3 :
33143314 version "9.5.3"
33153315 resolved "https://registry.yarnpkg.com/next/-/next-9.5.3.tgz#7af5270631f98d330a7f75a6e8e1ac202aa155e2"
33163316 integrity sha512-DGrpTNGV2RNMwLaSzpgbkbaUuVk30X71/roXHS10isSXo2Gm+qWcjonDyOxf1KmOvHZRHA/Fa+LaAR7ysdYS3A==
You can’t perform that action at this time.
0 commit comments