This repository was archived by the owner on Aug 23, 2022. It is now read-only.
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.