Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question