Releases: davidkpiano/react-redux-form
v1.11.2
Fixes and Enhancements
- The
onKeyPress
handler (passed to<Control>
) is now executed before anything else happens internally. See #790 for how this is useful. - Typescript def updates: #795 #794 #797
- Doc updates: #800
- If you are using
debounce
, any debounced changes will now automatically be "flushed" (i.e., dispatched immediately) whenever the<Control>
is about to be unmounted. #799 - Pressing Enter inside an input will now force validation/updating to occur, even if the control has
updateOn="blur"
. See #777 for the use case that this accommodates.
🇺🇸
v1.11.1
Lots of little (but important) fixes and updates here!
- Clarified docs and FAQ around controls of different types. #717
- Added missing type definition for
<Control.custom>
. #756 - Added missing argument for typedef of
onSubmit
for<Form>
components in e8b85a0 - An internal caching mechanism was removed (due to a few edge-case bugs) and a bug was fixed around dispatching
setInitial
. #782 - The state is now passed to comparison logic in
shouldComponentUpdate
, thanks to @dreid #758 - Various doc updates thanks to @romseguy - #761, #762
- Badge added thanks to @sufuf3 - #768
- If an
actions.change
action is dispatched, now the form will apply the change first before applying any other updates (which is the expected behavior). - #784
v1.11.0
This is an exciting release!! There's a few new features, bug fixes, and huge performance enhancements.
- Huge performance improvements thanks to @danielericlee in his PR: #755 👏
- Uses the new
areOwnPropsEqual
andareStatePropsEqual
options in React-Redux to do smartershouldComponentUpdate
testing
- Uses the new
- Documentation updates:
- No more
storeSubscription
warnings will occur in<Fieldset>
. #750 track()
now handles multi-value models correctly; e.g.,track('users[].pets[]', {id: 100})
- The
<Form onSubmit={(val, evt) => ...}>
prop now takes theevent
as the second argument, which makes things like file uploads much easier. #664
v1.10.2
This reverts the previous patch - standard prop mappings (such as onChange
, onBlur
, etc.) will be passed onto <Control>
components with custom components, as expected. See #743 for why that was important.
If you do not want any standard property mappings (such as onChange
, onBlur
, etc.) passed down to your custom control component, use <Control.custom>
and define your own mappings:
<Control.custom
component={SpecialCustomText}
mapProps={{
onTextChange: (props) => props.onChange,
onLoseFocus: (props) => props.onBlur,
// etc.
}}
/>
v1.10.1
This small patch ensures that the default mapping of props for common <input>
components are not passed down for custom controls defined like <Control component={CustomControl}>
.
v1.10.0
Enhancements and Fixes
Lots of updates in this minor version bump!
- The logic for the
value
of<Control.text>
components was improved (see 8579917 for the technical details) in order to quell some of the "component is switching from uncontrolled to controlled" errors.- If the value is
undefined
, an empty string is rendered instead. - Otherwise, the normal text value (string) of the
modelValue
is rendered, as usual. - For
<Control>
(default control), the value is not messed with. It is up to your custom component to do propervalue
checking. - Related to #714, #733, #739
- If the value is
- Small dependency updates (#738) and tsdef updates (#740)
- The
getValue
prop, once internal, is now exposed to<Control>
. See the docs for more info. - Because of this,
Control.checkbox
was refactored which solves #725. TheisToggle
prop is also exposed, which lets you indicate whether the control acts like a "toggle" (that is, its value remains the same but it affects the overall model value, like a checkbox or radio button). - React 15.5 came out which deprecated the internal use of
React.PropTypes
, so that was taken care of.
v1.9.0
Enhancements
<LocalForm>
now provides a thunk-enabled dispatcher for getDispatch
! This means you can pass in action thunk creators, like:
// in render():
<LocalForm
model="user"
getDispatch={(dispatch) => this.formDispatch = dispatch}
/>
// anywhere in the same component:
this.formDispatch(actions.merge('user', {
name: 'Jared',
state: 'Pennsylvania'
});
Very little code was required to make this happen, so don't worry, it doesn't create a dependency on redux-thunk
-- it works the exact same way, though.
Fixes
- HTML validation was fixed in components defined in
<LocalForm>
components. #734
v1.8.3
v1.8.2
- Using
defaultValue
in<Control>
components will no longer throw an error. While discouraged,defaultValue
can still be used to load the initial state onto a model as expected. #630 - Using a
customInitialFieldState
will now work for all actions in the form reducer. #713 - Docs improved for
mapProps
, thanks to @nigredo-tori #712 - Type refs updated for
setErrors
andsetFieldsErrors
- #710 - To prevent infinite loops, validation logic for handling async validation when a form's field changes has been moved to the form reducer itself. #706
- A lot of
CLEAR_INTENTS
noise was cleared up - now, actions can dispatch with.clearIntents
metadata, which will be handled correctly by the reducer, and make the logs cleaner.
React Redux Form v1.8.1
Enhancements and Fixes
- Adding model caching and properly removing form values with updated field models. See #619 for more details.
- The stray
console.error
was removed fromactions.submit
. Make sure you properly handle errors in your promises! #697 - The prop warning for
storeSubscription
should no longer be shown anymore 🎉 #698 - Small TS definition updates for
combineForms
andcreateForms
. #699 - Custom controls will no longer coerce non-strings to empty strings. #708
- The documentation was updated to note the subtle difference between
actions.load
andactions.change(model, { silent: true })
. In case you're curious:- both
.load
and.change
(silent) will silently change the value. - only
.load
will also set the.loadedValue
, which is the value that the control will be reset to uponactions.reset(model)
.
- both