<commit_before>import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { initialize } from 'redux-form';
import AddressChooser from './addressChooser.jsx';
import UserAddress, { formName } from './userAddress.jsx';
import {
  createLoadAddresses,
  createSaveAddress,
  createSelectAddress,
} from '../actions';
import { OrderStatePropType } from '../propTypes';

class AddressStep extends React.Component {
  componentWillMount() {
    this.props.loadAddresses();
  }

  render() {
    const {
      selectAddress,
      saveAddress,
      order,
    } = this.props;

    return (
      <div>
        <AddressChooser
          addresses={order.addresses}
          selectedAddressId={order.selectedAddress && order.selectedAddress._id}
          selectAddress={
            addressId => selectAddress(
              order.addresses.find(address => address._id === addressId),
            )
          }
        />
        <UserAddress onSubmit={saveAddress} />
      </div>
    );
  }
}

AddressStep.propTypes = {
  loadAddresses: PropTypes.func.isRequired,
  selectAddress: PropTypes.func.isRequired,
  saveAddress: PropTypes.func.isRequired,
  order: OrderStatePropType.isRequired,
};

export default connect(
  state => ({<commit_msg>remove unnecessary div and use array syntax<commit_after>import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { initialize } from 'redux-form';
import AddressChooser from './addressChooser.jsx';
import UserAddress, { formName } from './userAddress.jsx';
import {
  createLoadAddresses,
  createSaveAddress,
  createSelectAddress,
} from '../actions';
import { OrderStatePropType } from '../propTypes';

class AddressStep extends React.Component {
  componentWillMount() {
    this.props.loadAddresses();
  }

  render() {
    const {
      selectAddress,
      saveAddress,
      order,
    } = this.props;

    return [
      <AddressChooser
        key="addressChooserSelectBox"
        addresses={order.addresses}
        selectedAddressId={order.selectedAddress && order.selectedAddress._id}
        selectAddress={
          addressId => selectAddress(
            order.addresses.find(address => address._id === addressId),
          )
        }
      />,
      <UserAddress key="addressForm" onSubmit={saveAddress} />,
    ];
  }
}

AddressStep.propTypes = {
  loadAddresses: PropTypes.func.isRequired,
  selectAddress: PropTypes.func.isRequired,
  saveAddress: PropTypes.func.isRequired,
  order: OrderStatePropType.isRequired,
};

export default connect(
  state => ({
{'fraction_non_alphanumeric': 0.11704155547083492, 'fraction_numerical': 0.0, 'mean_word_length': 3.138801261829653, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, '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': '4725925', 'n_tokens_mistral': 741, 'n_tokens_neox': 739, 'n_words': 156}