Данные инпутов в форме

PHOTO EMBED

Fri Jul 01 2022 08:06:37 GMT+0000 (UTC)

Saved by @happy_cutman #react.js

const [inputs, setInputs] = useState({
    title: '',
    address: '',
    methodName: '',
    signatures: '',
    calldatas: ''
  }) 


const inputHandler = (event:React.ChangeEvent<HTMLInputElement>) => {
    setInputs({...inputs, [event.target.name]: event.target.value})
  };


<Input placeholder='Title' name='title' onChange={inputHandler}/>
<Input placeholder='Target contract address' name='address' onChange={inputHandler}/>
<Input placeholder='Method name' name='methodName' onChange={inputHandler}/>
content_copyCOPY