Input elements should not switch from controlled to uncontrolled ReactJs error

前端 未结 2 1852
梦谈多话
梦谈多话 2021-01-20 19:09

I\'m trying to handle changes in my form. I have title, description, and category.

The first input(title) -> Unable to type in the field.

The second input(d

2条回答
  •  孤街浪徒
    2021-01-20 19:57

    change your function to

     handleChange(e) {
        this.setState({
            [e.target.name] : e.target.value
        }); 
    }
    

提交回复
热议问题