.map () does nothing and does not cause errors - reacts

I am programming in Reactjs, es6 / 2015. So I am trying to use .map () over an array (for example, I did sooo many times before). When I type Array on the console, I get all the correct information, but nothing happens. I cannot display the component I want, or plain h1. There are no errors in the console or in my watch of the web pack. I just have no idea what is going wrong, the code corresponds to another code that I wrote almost to the letter, and the other works. The only real difference between them is the different variable names. My code is:

show = [{content}, {content}, {content}];

render () {
 return <div className="box">
  {show.map( (item, key) => {
    <MyComponent item={item} key={key} 
                 choice={this.choice.bind(this)} />
  })}
 </div>;
 }

Any help is appreciated.

+4
source share
1 answer

, .

:

render () {
 return <div className="box">
  {show.map( (item, key) => {
    return <MyComponent item={item} key={key} choice=this.choice.bind(this)} />
  })}
 </div>;
 }

, ( - ).

+4

All Articles