0

I have created a two components:

  1. Comment - renders a comment's content and edit option(this option is created from the below component)
  2. 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:

Edit kxw3lvl78v

1 Answer 1

1

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
    />
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.