Reputation: 1432
I have created a two components:
Comment
- renders a comment's content and edit option(this option is created from the below component)EditComment
- renders a link and onClick of that link renders a
modal where comment can be edited.The problem here is the input type='textarea'
is fixed and I am unable to modify it.
Here is the working model of code:
Upvotes: 0
Views: 49
Reputation: 3103
in this function
handleChange(event) {
this.setState({
[event.target.name]: event.target.value
});
}
event.target.name
is blank
You have to add a name to the input like so.
<Input
name="content"
type="textarea"
placeholder="Edit your Comment here!"
value={this.state.content}
onChange={this.handleChange}
required
/>
Upvotes: 1