I
I
Isaac Clark2015-11-23 21:51:57
React
Isaac Clark, 2015-11-23 21:51:57

How to create in React.js option?

Hello, I have an array:

var arr = [
    ['1', '2', '3'],
    ['one', 'two', 'three']
];

With the power of react, you need to create a select so that the loop goes through the array once, but at the same time renders two selects. The first one should contain the data 1,2,3 , and the second one, two, three.
This way of course does not work:
arr.map(function (opt, i) {
    return <option key={i}>{opt}</option>
})

Tell me, what are the options?
thanks for the help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2015-11-24
@Vovchikvoin

https://jsfiddle.net/ProReact/69z2wepo/22150/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question