This repository was archived by the owner on Aug 23, 2022. It is now read-only.
Releases: davidkpiano/react-redux-form
Releases · davidkpiano/react-redux-form
React Redux Form v0.13.5
React Redux Form v0.13.4
** Enhancements **
- HUGE thanks to @hsrobflavorus for his work on creating a TypeScript definition file, recent up to the current version: #248 🎉
- Some performance optimizations made in preventing redundantly dispatched
setErrors
actions. - More examples added! Huge thanks to @etrepum: #234
React Redux Form v0.13.3
- Slightly easier way to handle custom components in
<Field>
by specifying themapProps={...}
prop (function), which will be executed for every child inside<Field>
:
<Field model="foo.bar" mapProps={controls.text}>
<MyCustomTextInput />
</Field>
Best practice: Use this only when you have a single child inside <Field>
for best results.
- Fixed #238 which threw an error if a
formReducer
for a<Form>
component did not exist.
React Redux Form v0.13.2
Examples!
- Thanks to @etrepum, we've set up the foundation for runnable examples in the repo, with more to come! Right now, the basic quick start example is available by running:
npm install
npm run examples
Feel free to let us know which examples you'd like to see in the repo!
Performance enhancements
- The
<Errors>
component no longer requires the entire state inmapStateToProps
, nor does the<Form>
component, resulting in a significant performance boost. #237 - The
<Form>
component now benefits from React'sshallowCompare
for efficient rendering.
Bug fixes
React Redux Form v0.13.0
Performance and Size Enhancements
- Many lodash dependencies were removed, such as
isEqual
,merge
, etc. There is still a lot of work to be done in cutting down the size, but it's a noticeable improvement. - (Internal) props are no longer sequenced and mapped on every single update in the
<Control>
component - instead, they are "cached" in the component's internal state until the<Control>
absolutely needs to rerender. Only then will props be remapped. This results in huge performance benefits ( #227 ). More is to be done in this area! - Redundant form-wide validation actions have been eliminated for
<Form>
components that don't have anyvalidators
. In the future, RRF will be even smarter about when it can batch and/or avoid dispatching actions when it can predict that the form state will not change.
Other Minor Changes
- The
actions.xor(model, item, [iteratee])
now takes in an optionaliteratee
3rd argument that answers the question, "Which item am I looking for?" Here's an example:
// Suppose you have a state that looks like this:
// { foo: { collection: [{ a: 1 }, { a: 2 }] } }
dispatch(actions.xor('foo.collection', { a: 2 }, (val) => val.a === 2));
// => will remove `{ a: 2 }` because it is found in the collection
dispatch(actions.xor('foo.collection', { a: 42 }, (val) => val.a === 42));
// => will add `{ a: 42 }` because it is not present in the collection
For most intents and purposes, you will not need to worry about this if you are dealing with primitive (numbers, strings, etc.) values. That is, actions.xor(['a', 'b', 'c'], 'b')
will continue to work as expected.
React Redux Form v0.12.7
Bug Fixes
- Previously, for most cases, a text
<input />
could not be uncontrolled; i.e., it was forced to be controlled, and thevalue
prop was overridden. This was undesirable in some instances, and now,<input value={...} />
inside<Field>
will maintain its originalvalue
prop, if it exists. This yields two new scenarios:
// force an input to be uncontrolled
<Field model="foo.bar">
<input value={undefined} />
</Field>
// control an input externally
<Field model="foo.bar">
<input value={this.state.value} onChange={...} />
</Field>
- The
SET_SUBMITTED
andSET_SUBMIT_FAILED
actions now propagate to the form's underlying fields, so the.submitted
and.submitFailed
field props accurately represent those of the parent form. #222
React Redux Form v0.12.6
Internal Changes
React Redux Form v0.12.5
Enhancements
- Now,
.retouched
is set totrue
once anychange
happens, as opposed toblur
, which makes sense, since the field is already "touched" after a submit is attempted.
Internals
- The pre-existing behavior of
cloneElement
is brought back to<Control>
when existing components are passed intocontrol={...}
, to maintainref
and improve performance.
React Redux Form v0.12.3
Optimizations
react-redux-shallow-compare
is now added to the<Field>
component to prevent renders when the field has not changed. #205- Some lodash functions were internalized to reduce bundle size, such as
partial
andcapitalize
.
v0.12.2
- New (mostly internal) field flag:
.validated
indicates whether the field's current value has been validated or not.- Whenever the value changes (
CHANGE
action),.validated
will be reset tofalse
since that value has not been validated yet. - Once it is validated,
.validated = true
.
- Whenever the value changes (
- Enhancement: now, validators defined on
<Field>
will get executed whenever it detects that its model's value has changed.