1
0
Fork 0

Fix hookup of newpost thanks markpassando

This commit is contained in:
Amarpreet Minhas 2019-10-19 18:44:22 -04:00
parent bc6dadb350
commit bd20aecb06

View file

@ -2,35 +2,23 @@ import React from 'react';
import ReactMde from "react-mde";
import ReactMarkdown from 'react-markdown';
import 'github-markdown-css'
import "react-mde/lib/styles/css/react-mde-all.css"
class NewPost extends React.Component {
constructor (props) {
super(props)
this.state = {
title: '',
content: ''
}
}
handleChange = value => {
this.setState({ mdeValue: value });
};
render () {
const NewPost = (props) => {
const [value, setValue] = React.useState("**Hello world!!!**");
const [selectedTab, setSelectedTab] = React.useState("write");
return(
<div className="container">
<ReactMde
value={this.state.content}
/*
value={value}
onChange={setValue}
selectedTab={selectedTab}
onTabChange={setSelectedTab}
*/
generateMarkdownPreview={(markdown) => <ReactMarkdown source={markdown} />}
generateMarkdownPreview={(markdown) =>
Promise.resolve(<ReactMarkdown source={markdown} />)}
/>
</div>
)
}
}
export default NewPost;