react-redux-universal-hot-example
react-redux-universal-hot-example copied to clipboard
Update react-final-form to the latest version ๐
The dependency react-final-form was updated from 4.1.0 to 5.0.0.
This version is not covered by your current version range.
If you donโt accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update.
Release Notes for v5.0.0
๐ v5.0.0 โ HOOKS!!! ๐
First to explain why this change was made... To manage subscriptions to the internal React.useEffect() hook. In an effort to modernize and future proof the library, the entire thing has been rewritten to use hooks.
All the previous tests have been rewritten to use v4 should work in v5, including some optimizations to minimize superfluous additional renders that were made possible by hooks.
โ ๏ธ BREAKING CHANGES ๐ฎ
Don't worry...there really aren't that many.
- Requires
^[email protected]. That's where the hooks are.๐ - All deprecated functions provided in
FormRenderPropsandFormSpyRenderPropshave been removed. They have been spitting warnings at you sincev3, so you've probably already corrected for this. The following applies to:batchblurchangefocusinitializemutatorsreset
Rather than spreading the FormApi into the render props, you are just given form itself.
v4
<Form onSubmit={submit}>{({ reset }) => (
// fields here
<button type="button" onClick={reset}>Reset</button>
)}</Form>v5
<Form onSubmit={submit}>{({ form }) => (
// fields here
<button type="button" onClick={form.reset}>Reset</button>
)}</Form>Fieldwill no longer rerender when thevalidateprop. Note: it will still always run the latest validation function you have given it, but it won't rerender when the prop is!==. This is to allow the very common practice of providing an inline=>function as a field-level validation function. This change will break the very rare edge case where if you are swapping field-level validation functions with different behaviors on subsequent renders, the field will no longer rerender with the new validation errors. The fix for this is to also change thekeyprop onFieldany time you swap thevalidatefunction. See this test for an example of what I mean.
๐ New Hook API ๐
Because it was so easy to do, useField and useFormState hooks that are used internally in Field and FormSpy respectively. Literally the only thing Field and FormSpy do now is call their hook and then figure out if you are trying to render with the component, render, or children prop.
For example, before v5, if you wanted to create a custom error component that only rerendered when touched or error changed for a field, you'd have to do this:
v4
const Error = ({ name }) => (
<Field name={name} subscription={{ touched: true, error: true }}>
{field =>
field.meta.touched && field.meta.error ? (
<span>{field.meta.error}</span>
) : null
}
</Field>
)...but now you can do:
v5
const Error = ({ name }) => {
const field = useField(name, { subscription: { touched: true, error: true } })
return field.meta.touched && field.meta.error ? (
<span>{field.meta.error}</span>
) : null
}Not too groundbreakingly different, but these hooks might allow for some composability that was previously harder to do, like this clever disgusting hack to listen to multiple fields at once.
Go forth and hook all the things!
Special thanks to @Andarist for giving me such an extensive code review on #467.
Commits
The new version differs by 14 commits.
35b85b95.0.0376fc69Removed deprecated api from docsc851c78Removed misguided hooks docsffd2003Hooks!!! (#467)41d24d6Added CLI example45d5e97Fixed anchor for selective examplebfa390eMerge branch 'master' of github.com:final-form/react-final-form230c169Upgraded deps and fixed vulnerabily with tar packagecb17dc5Added selective debounce demoe8138a3Fix onChange TS type signature (#438)5f036e2Update readme that warnings do not prevent submit (#447)a3ca5f1Fixed tslint errors6cc9b12Unify TS tests & backport removed typing improvements (#435)d68a91fv4.1.0
See the full diff
FAQ and help
There is a collection of frequently asked questions. If those donโt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper bot :palm_tree:
- The
dependencyreact-final-form was updated from4.1.0to5.0.1.
- The
dependencyreact-final-form was updated from4.1.0to5.0.2.
- The
dependencyreact-final-form was updated from4.1.0to5.1.0.
- The
dependencyreact-final-form was updated from4.1.0to5.1.1.
- The
dependencyreact-final-form was updated from4.1.0to5.1.2.
- The
dependencyreact-final-form was updated from4.1.0to6.0.0.
- The
dependencyreact-final-form was updated from4.1.0to6.0.1.
- The
dependencyreact-final-form was updated from4.1.0to6.1.0.
- The
dependencyreact-final-form was updated from4.1.0to6.2.0.
- The
dependencyreact-final-form was updated from4.1.0to6.2.1.
- The
dependencyreact-final-form was updated from4.1.0to6.3.0.
- The
dependencyreact-final-form was updated from4.1.0to6.3.1.
- The
dependencyreact-final-form was updated from4.1.0to6.3.2.
- The
dependencyreact-final-form was updated from4.1.0to6.3.3.
- The
dependencyreact-final-form was updated from4.1.0to6.3.5.
- The
dependencyreact-final-form was updated from4.1.0to6.4.0.
๐จ Reminder! Less than one month left to migrate your repositories over to Snyk before Greenkeeper says goodbye on June 3rd! ๐ ๐๐จ ๐
Find out how to migrate to Snyk at greenkeeper.io
- The
dependencyreact-final-form was updated from4.1.0to6.5.0.