score:1

Accepted answer

You need to pass it in the binding:

var Board = React.createClass({
//dungeon map available in this.props.board  

render: function() {

    return (

    <table className="table">
        {
        this.props.board.map(function(item,index){
        //loop through every element of the board array
        //these are the rows

        var row = index;

            return (

            <tr>
                {

                /** NOTICE rowIndex **/  
                item.map(function(rowIndex, item,index){

                    var position = [row, index]
                    //this does not work for row
                //row from outer map loop not accessible

                    return (

                    <Cell value={item} position ={rowIndex}/>

                    )

                /** NOTICE we pass the row's index to binding **/
                }.bind(this, index))


                }

            </tr>  


            )


        }.bind(this))

        } 
    </table>

    )

}

});

NOTE: The order matters. notice rowIndex is first.


Related Query

More Query from same tag