노션에 작성한 content를 react에서 사용해보자!
yarn add react-notion


export default function App() {
const [notionData, setNotionData] = useState(false);
useEffect(() => {
axios({
url: "https://notion-api.splitbee.io/v1/page/${id 값}",
})
.then((res) => {
console.log(res);
setNotionData(res.data);
})
.catch((err) => console.log(err));
}, []);
return (
<div
style={{
margin: "auto",
width: "50vw",
}}
>
{notionData && <NotionRenderer blockMap={notionData} />}
</div>
);
}

json 파일로 저장해서 보여주기주소창에 https://notion-api.splitbee.io/v1/page/${id 값} 을 입력합니다.

위와 같이 json 데이터가 나오는데 이것을 저장해서 사용합니다.
import content from "./content.json";
export default function App() {
return (
<div
style={{
margin: "auto",
width: "50vw",
}}
>
<NotionRenderer blockMap={content} />
</div>
);
}