Skip to content

Instantly share code, notes, and snippets.

@alexandargyurov
Created June 8, 2020 18:17
Show Gist options
  • Save alexandargyurov/455c23fe9cfd3bea06199c691a282625 to your computer and use it in GitHub Desktop.
Save alexandargyurov/455c23fe9cfd3bea06199c691a282625 to your computer and use it in GitHub Desktop.
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