Skip to content

Commit

Permalink
Passthrough the initialValues prop to the enhanced component.
Browse files Browse the repository at this point in the history
  • Loading branch information
ruiaraujo committed Aug 23, 2016
1 parent d2c8f29 commit 7079eff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/api/Props.md
Expand Up @@ -167,6 +167,10 @@ that as if it were the error for a field called `_error`, and it will be given a
determined by comparing the current data with these initialized values.
This is a bound action creator, so it returns nothing.

#### `initialValues : Object`

> The same initialValues object passed to `reduxForm` to initialize the form data.
#### `invalid : boolean`

> `true` if the form has validation errors. Opposite of `valid`.
Expand Down
2 changes: 2 additions & 0 deletions src/__tests__/reduxForm.spec.js
Expand Up @@ -86,6 +86,7 @@ const describeReduxForm = (name, structure, combineReducers, expect) => {
'error',
'form',
'handleSubmit',
'initialValues',
'initialize',
'initialized',
'invalid',
Expand Down Expand Up @@ -373,6 +374,7 @@ const describeReduxForm = (name, structure, combineReducers, expect) => {
expect(props.pristine).toBe(true)
expect(props.dirty).toBe(false)
expect(props.initialized).toBe(false) // will be true on second render
expect(props.initialValues).toEqualMap(initialValues)
}
checkProps(formRender.calls[ 0 ].arguments[ 0 ])

Expand Down
1 change: 1 addition & 0 deletions src/reduxForm.js
Expand Up @@ -358,6 +358,7 @@ const createReduxForm =
handleSubmit: this.submit,
initialize,
initialized,
initialValues,
invalid,
pristine,
reset,
Expand Down

0 comments on commit 7079eff

Please sign in to comment.