title: Passing dynamic form values redux-form
body: <p>I have a prop called <code>profileDetails</code> and I want to use it to set form values. Is the a way to dynamically add <em>multiple</em> form values in redux-form? </p>
  
  <p>I tried <code>values: this.props.profileDetails</code> and <code>values: profileDetails</code> I get <code>Uncaught ReferenceError: &lt;variable&gt; is not defined</code> on both.</p>
  
  <p>EDIT: I tried using <code>values: ...</code> and <code>initialValues: ...</code> in <code>reduxForm({})</code>.</p>
  
  <pre><code>import React from 'react';
  import PropTypes from 'prop-types';
  import { Field, reduxForm } from 'redux-form';
  import { InputField } from '~/shared/components/formFields';
  
  const ProfileEditComponent = ({
    handleSubmit,
    profileDetails,
   }) =&gt; (
    &lt;form onSubmit={handleSubmit} className="form-horizontal"&gt;
    &lt;Field
      name="first_name"
      type="text"
      component={InputField}
      label="First Name"
      labelClass="col-sm-2"
      inputDivClass="col-sm-10"
      value={profileDetails.first_name}
    /&gt;
    &lt;/form&gt;
  );
  
  export default reduxForm({
    form: 'profile-edit-form',
    destroyOnUnmount: false,
    enableReinitialize: true,
    value: profileDetails // &lt;-- how do I pass profileDetails dynamically?
  })(ProfileEditComponent);
  
  
  // Input component
  
  import React from 'react';
  import PropTypes from 'prop-types';
  
  const InputField = ({ ...props }) =&gt; (
    &lt;div className="form-group"&gt;
      &lt;label
        htmlFor={props.input.name}
        id={props.input.name}
        className={props.labelClass}
      &gt;
        {props.label}
      &lt;/label&gt;
      &lt;div className={props.inputDivClass}&gt;
        &lt;input
          type={props.type}
          name={props.input.name}
          className="form-control"
          value={props.input.value}
          {...props.input}
        /&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  );
  
  InputField.propTypes = {
    type: PropTypes.string,
    name: PropTypes.string,
    value: PropTypes.string,
    input: PropTypes.shape(),
    label: PropTypes.string,
    labelClass: PropTypes.string,
    inputDivClass: PropTypes.string,
  };
  
  InputField.defaultProps = {
    type: '',
    name: undefined,
    value: undefined,
    input: {},
    label: '',
    labelClass: '',
    inputDivClass: '',
  };
  
  export default InputField;
  </code></pre>