title: Dynamically load initialValues in Redux Form
body: <p>Using the example of <a href="http://redux-form.com/5.2.3/#/examples/initializing-from-state?_k=8zpk58" rel="noreferrer">initializingFromState</a> within Redux-Form, I am trying to set this up dynamically. This is to edit a particular book in a list of books, and is using a simple api set up in express.js.</p>
  
  <p>The full container is below. I somehow need to pass in <code>initialValues</code>, within the <code>mapStateToProps</code> function. In the example, it is done via a static object, but I can't work out how to use the information I have pulled in via <code>fetchBook</code>, and pass it to <code>initialValues</code>.</p>
  
  <p>Container:</p>
  
  <pre><code>import React, { Component, PropTypes } from 'react';
  import { reduxForm } from 'redux-form';
  import { connect } from 'react-redux';
  import { Link } from 'react-router';
  import { fetchBook, editBook } from '../actions/index';
  
  class BookEdit extends Component {
  
    componentWillMount() {
        this.props.fetchBook(this.props.params.id);
    }
  
      static contextTypes = {
      router: PropTypes.object
      }
  
    onSubmit(props) {
      this.props.editBook(this.props.book.id, props)
        .then(() =&gt; {
          this.context.router.push('/');
        });
    }
  
      const data = {
          title: {this.props.book.title},
          description: {this.props.author}
      }
  
    render() {
  
      const { fields: { title, author }, handleSubmit } = this.props;
      const { book } = this.props;
  
      if (!book) {
        return (
            &lt;div&gt;
              &lt;p&gt;Loading...&lt;/p&gt;
            &lt;/div&gt;
        )
      }
  
      return (
        &lt;div&gt;
        &lt;Link to="/"&gt;Back&lt;/Link&gt;
          &lt;form onSubmit={handleSubmit(this.onSubmit.bind(this))}&gt;
                  &lt;h2&gt;Add a new book&lt;/h2&gt;
  
                  &lt;label&gt;Title&lt;/label&gt;
                  &lt;input type="text" {...title} /&gt;
                  &lt;div className="text-help"&gt;{title.touched ? title.error : ''}&lt;/div&gt;
  
                  &lt;label&gt;Author&lt;/label&gt;
                  &lt;input type="text" {...author} /&gt;
                  &lt;div className="text-help"&gt;{author.touched ? author.error : ''}&lt;/div&gt;
  
                  &lt;button type="submit"&gt;Add&lt;/button&gt;
                  &lt;Link to="/" className="button"&gt;Go back&lt;/Link&gt;
              &lt;/form&gt;
        &lt;/div&gt;
      );
    }
  }
  
  function mapStateToProps(state) {
    return {
        book: state.books.book,
        initialValues: // how do I pass in the books here?
    };
  }
  
  export default reduxForm({
    form: 'EditBookForm',
    fields: ['title', 'author']
  }, mapStateToProps, { fetchBook, editBook })(BookEdit);
  </code></pre>
  
  <p>Thank you.</p>