This repository has been archived on 2026-04-30. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
mechaimmensewarfare.com/src/pages/rules.jsx
T
2018-12-10 02:06:45 +11:00

38 lines
625 B
React

import React from "react";
import ReactMarkdown from "react-markdown";
class Rules extends React.Component {
constructor(props) {
super(props);
this.state = {
body: "Loading..."
};
}
componentDidMount() {
fetch("/content/rules.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>
<ReactMarkdown source={this.state.body} />
</div>
);
}
}
export default Rules;