Created
June 8, 2020 18:17
-
-
Save alexandargyurov/455c23fe9cfd3bea06199c691a282625 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { NotionRenderer } from "react-notion"; | |
import "react-notion/src/styles.css"; | |
import "prismjs/themes/prism-tomorrow.css"; | |
class App extends React.Component { | |
constructor(props) { | |
super(props) | |
this.state = { | |
blockMap: {} | |
} | |
} | |
async componentDidMount() { | |
const blogData = await fetch( | |
"https://notion-api.splitbee.io/v1/page/9563b7718c044d06b3e707374e8ed141" | |
).then(res => res.json()); | |
this.setState({ blockMap: blogData }) | |
} | |
render() { | |
return ( | |
<div> | |
<NotionRenderer fullPage blockMap={this.state.blockMap} /> | |
</div> | |
) | |
} | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment