Skip to content

Commit

Permalink
passing the last initialValues into initialize action if it is reinit…
Browse files Browse the repository at this point in the history
…ializing the form (#2835)

* passing the last initialValues into initialize action if it is reinitializing the form

* Added test related to #2809

* Removed meta.touched from FieldArray props (#2836)

* Add props to the params documented in the field-level validations example (#2855)

* Fix typo in docs/api/Field.md (#2864)

* Improve SubmissionError docs (#2873)

* Add a selector to get touched and visited props from state (#2859)

* added a selector (getFormMeta) which retrieves the form.{$name}.fields slice from state

* added documentation for getFormMeta selector

* Fixed field-level validation reset bug (#2888)

* deleteInWithCleanUp needs to check if there is a value in the state before deleting. (#2876)

* deleteInWithCleanUp needs to check if there is a value in the state before deleting, to avoid Invalid KeyPath errors

* Got rid of string compare

* clean script - added es folder to be rimrafed before build (#2860)

* Add a Field's initial value to props.meta.initial (#2858)

* Add meta.initial to Field props for access to a field’s initial value.

* es6 typo

* add meta.initial to the docs for Field

* Demonstrated that calling onBlur() does not change value #2768

* Better cleanup on UNREGISTER (#2889)

* Checkbox default behavior proposal (#2863)

instead true/false to be true/'' as the current true/false breaks pristine prop

* Fancy new npm5 lock file!

* Allow direct imports to reduce bundle size. (#2893)

* Fix deep equal on maps with different structures (#2892)

* Remove references to react-router from doc page. (#2898)

* Add PropTypes for the Field components (#2862)

* Add PropTypes for the Field components

* Export fieldInputPropTypes, fieldMetaPropTypes and fieldPropTypes

* Merged with changes from #2893

* Exports defaultShouldValidate and defaultShouldAsyncValidate (#2891)

* Exports defaultShouldValidate and defaultShouldAsyncValidate

These default functions are exported for external use - particularly so
that a user can wrap the default functionality with specialised behaviour.

To resolve #2890

* Export default shouldValidates in immutable wrapper

* Allow direct imports to reduce bundle size. (#2893)

* Fix deep equal on maps with different structures (#2892)

* Remove references to react-router from doc page. (#2898)

* Add PropTypes for the Field components (#2862)

* Add PropTypes for the Field components

* Export fieldInputPropTypes, fieldMetaPropTypes and fieldPropTypes

* Merged with changes from #2893
  • Loading branch information
sckoh authored and erikras committed May 9, 2017
1 parent 7bd780d commit 7c6af82
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/createReduxForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ const createReduxForm =
if (nextProps) {
if ((enableReinitialize || !nextProps.initialized) && !deepEqual(this.props.initialValues, nextProps.initialValues)) {
const keepDirty = nextProps.initialized && this.props.keepDirtyOnReinitialize
this.props.initialize(nextProps.initialValues, keepDirty)
this.props.initialize(nextProps.initialValues, keepDirty, {
lastInitialValues: this.props.initialValues,
})
}
} else if (this.props.initialValues && (!this.props.initialized || enableReinitialize)) {
this.props.initialize(this.props.initialValues, this.props.keepDirtyOnReinitialize)
Expand Down

1 comment on commit 7c6af82

@ChristophVitz-ItSonix
Copy link

@ChristophVitz-ItSonix ChristophVitz-ItSonix commented on 7c6af82 May 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a bug in the way the prop types are aggregated and exported.
https://github.com/erikras/redux-form/blob/master/src/propTypes.js#L84

The isRequired is not defined on these objects, this results in the exported meta and input properties to be undefined

I think the following line

export const fieldInputPropTypes = {

should be replaced with

export const fieldInputPropTypes = shape({

Please sign in to comment.