Introduction.jsx
690 Bytes
import React, { Component, Fragment } from 'react'
import Axios from 'axios'
import IntroductionMd from './resources/md/IntroductionMd.md'
import ReactMarkdown from 'react-markdown'
export default class Introduction extends Component {
state = {
terms: null
}
componentDidMount() {
this._requestIntroduction()
}
_requestIntroduction = async () => {
await Axios({
method: 'get',
url: IntroductionMd,
responseType: 'text'
}).then(res => {
this.setState({ terms: res.data })
})
}
render() {
return (
<Fragment>
<ReactMarkdown source={this.state.terms} className={'markdown-body'} />
</Fragment>
)
}
}