I have an array and i have a simple string value. I want to mapping my array because i\'m try to find my string value.
I have a code like this, but map function doe
you should return the map function itself, and you can achieve it with es6 single line arrow functions too
class Application extends React.Component {
constructor(){
super();
this.state = {
questionAnswer: 'is that possible',
question: ['is', 'possible', 'that']
}
}
renderKeywords() {
return this.state.question.map((item, i) =>{item}
});
}
render() {
return (
blabla
{this.renderKeywords()}
);
}
}
React.render( , document.getElementById('app'));