On optn we have following data
"optn": [
"ഫത്തേപ്പൂര് സിക്രി",
"ഖജൂരാഹോ ക്ഷേത്രം",
"ചാര്മിനാര്",
"കുത്തബ്മീനാര്"
],
iteration done as below,but while calling example[0] getting only first letter like "ഫ", "ഖ", "ച", "ക" on 'example' only getting error
Invariant Violation:Objects are not valid as a react child(found: object with keys{key,index}) if you meant to render a collection of children use an array instead
objAns= this.state.optn.map((example,index) =>{
return(
<View key={index.toString()} >
<RadioButton currentValue={this.state.value} value={index+1} onPress={this.handleOnPress.bind(this)}>
<Text>{example[0]}</Text>
</RadioButton>
</View>
);
});
if we using {example[0]}{example[1]}{example[2]}then we get next letters and if optn contain English words then no problem it will work but i have to manage these type of data so how to solve such issue. is it possible to use 'for loop' inside ?