I am new to react js . Here, I have one array of obj which is ,
let criterias = [{
type: 'Low',
noc: 6,
data: this.props.lowData
}, {
type: 'Medium',
noc: 7,
data: this.props.MediumQuizData
},
{
type: 'High',
noc: 7,
data: this.props.HighData
}]
which I am using like this,
{criterias.map(criteria => (
<LowLevelCriteria techData={this.state.technologies} data={criteria.data} type={criteria.type} noc={criteria.noc} handler={this.handler.bind(this)} />
))}
Now, In the LoweverCriteria.js
,
{(this.props.data) && this.props.data.type.map((data, index) => (
<LowRow technologies={this.state.technologies} onChange={this.onchange.bind(this)} index={index + 1} data={data} key={data.id} onAddRow={this.onaddRow.bind(this)} onRemoveRow={this.onRemoveRow.bind(this)}
hasError={this.state.hasError}
/>
So, In this I want to use that props here like ,
this.props.data.{this.props.type}.map, so that type value is a dynamic. so I am not understanding How to do this ? I tried with
let type = this.props.type, and then using type , but no luck. so, can any one help me with this ?