M
M
MrBodyJs2021-05-17 21:22:59
In contact with
MrBodyJs, 2021-05-17 21:22:59

How to write data from inputs (ReactJs)?

Used by VK-UI ( https://vkcom.github.io/VKUI/ )

const methods = [{method: 'users.get', params: [{'user_ids'}, {'fields'}]}]


this.state = {
'method': methods[0].method,
'params': methods[0].params


<FormLayoutGroup mode="horizontal">
{this.state.params.map(res=> (
<FormItem top={Object.keys(res)}>
<Input onChange={this.onChange}/>
</FormItem>
))}
</FormLayoutGroup>


async onChange(e) {
    const { value } = e.currentTarget;
    await this.setState({ method: method, params: methods[method].params});
  }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question