Passing an additional parameter with an onChange event

前端 未结 7 812
生来不讨喜
生来不讨喜 2021-01-31 07:33

What I\'m trying to do:

I am trying to pass a string from a child component to the handleChange function of a parent component.

What cur

相关标签:
7条回答
  • 2021-01-31 08:08
    const handleChange = (tags) => (event) => {
    // console.log(tags);
    // console.log(event.target.value);
    };
    
    <input
          type="text"
          name="name"
          placeholder="Name"
          value={input.Iname}
          onChange={handleChange("Iname")}
        />
    
    0 讨论(0)
提交回复
热议问题