<commit_before>import React from 'react';
import { connect } from 'react-redux';
import MenuItem from 'components/MenuItem';
import { FormattedMessage } from 'react-intl';
import { selectBrowserMenu } from 'containers/BrowserPage/selectors';
import messages from './messages';
import styles from './styles.css';

export class MusicMenu extends React.Component { // eslint-disable-line react/prefer-stateless-function

  render() {
    let menuItems = this.props.menu.items.map(({title, path}) => (
      <MenuItem key={path} title={title} />
    ))
    return (
      <div className={styles.musicMenu}>
        {menuItems}
      </div>
    );
  }
}

const mapStateToProps = (state) => ({
  menu: selectBrowserMenu(state),
})

const mapDispatchToProps = (dispatch) => ({
  dispatch,
})

export default connect(mapStateToProps, mapDispatchToProps)(MusicMenu);
<commit_msg>add a comment for react dynamic children<commit_after>import React from 'react';
import { connect } from 'react-redux';
import MenuItem from 'components/MenuItem';
import { FormattedMessage } from 'react-intl';
import { selectBrowserMenu } from 'containers/BrowserPage/selectors';
import messages from './messages';
import styles from './styles.css';

export class MusicMenu extends React.Component { // eslint-disable-line react/prefer-stateless-function

  render() {
    // https://facebook.github.io/react/docs/multiple-components.html#dynamic-children
    let menuItems = this.props.menu.items.map(({title, path}) => (
      <MenuItem key={path} title={title} />
    ))
    return (
      <div className={styles.musicMenu}>
        {menuItems}
      </div>
    );
  }
}

const mapStateToProps = (state) => ({
  menu: selectBrowserMenu(state),
})

const mapDispatchToProps = (dispatch) => ({
  dispatch,
})

export default connect(mapStateToProps, mapDispatchToProps)(MusicMenu);

{'fraction_non_alphanumeric': 0.13915857605177995, 'fraction_numerical': 0.0, 'mean_word_length': 4.167130919220056, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6698025', 'n_tokens_mistral': 541, 'n_tokens_neox': 536, 'n_words': 129}