Working on content

This commit is contained in:
2018-12-08 09:11:21 +11:00
parent ba465dcb17
commit 62e6d31692
3 changed files with 33 additions and 1 deletions
+22 -1
View File
@@ -1,14 +1,35 @@
import React from "react";
import ReactMarkdown from "react-markdown";
class Landing extends React.Component {
constructor(props) {
super(props);
this.state = {
body: "Loading..."
};
}
componentDidMount() {
fetch("/content/landing.md")
.then(result => result.text())
.then((result) => {
this.setState({
body: result
});
},
//handle errors here instead of a catch block because internet said so
(error) => {
this.setState({
body: error
});
});
}
render() {
return (
<div>
<p>Landing</p>
<ReactMarkdown source={this.state.body} escapeHtml={false} />
</div>
);
}