When I run the program, I can't enter a value in the input, help me
const handleChange = (event) => {
const { name, value } = event.target;
console.log(value);
setData(data => ({
...data,
[name]: value,
}));
};
const handleSubmit = () => {
setComments([...comments, { content: data.content }]);
};
const FormCommnent = ({ onChange, onSubmit, value }) => (
<div className="form-comment">
<MDEditor
value={value}
onChange={onChange}
name="content"
rows={4}
autoFocus={0}
preview='edit'
/>
<MDEditor.Markdown source={value} />
<Button htmlType="submit" onClick={onSubmit} >
Add Comment
</Button>
</div>
);
Top comments (0)