-
Notifications
You must be signed in to change notification settings - Fork 2
fix(deps): update dependency formik to v2 #3143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
5a922c1 to
879973b
Compare
879973b to
9bb06aa
Compare
9bb06aa to
9b051a9
Compare
9b051a9 to
7032405
Compare
7032405 to
535234a
Compare
535234a to
dd9d65c
Compare
dd9d65c to
1ef5e63
Compare
1ef5e63 to
6ded0e8
Compare
6ded0e8 to
14b0a16
Compare
14b0a16 to
0bc2756
Compare
0bc2756 to
8515031
Compare
8515031 to
127ee0b
Compare
127ee0b to
70543f9
Compare
70543f9 to
fdbfed8
Compare
fdbfed8 to
e4e56f7
Compare
e7e19f0 to
14b477e
Compare
24da22d to
61094e4
Compare
|
We were using refs in B2BPurchaseForm(Formik) Formik's Official Discussion around this => jaredpalmer/formik#2208 |
7692af3 to
9b7b928
Compare
5dc2e5f to
5e9e5ca
Compare
a269500 to
e254fdd
Compare
e254fdd to
37cfa3f
Compare
Deprecated Formik render replaced with childrens
Edited/Blocked NotificationRenovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. |
This PR contains the following updates:
^1.5.1->^2.0.0Release Notes
jaredpalmer/formik (formik)
v2.4.6Compare Source
v2.4.5Compare Source
Patch Changes
d7db9cd#3860 Thanks @patik! - Add missing dependency@types/hoist-non-react-statics, closes #3837fe4ed7e#3501 Thanks @markspolakovs! - Markformikas side-effect free inpackage.jsonv2.4.4Compare Source
Patch Changes
41720c2#3862 Thanks @yazaldefilimonepinto! - ForwardclassNamefor custom components used withFieldda58b29#3858 Thanks @alaanescobedo! - Remove use of deprecatedStatelessComponenttype in favor ofFunctionComponent5c01ee7#3872 Thanks @rajpatelbot! - FIX: Fixed resetForm function dependency issuev2.4.3Compare Source
Patch Changes
9e0a661#3843 Thanks @bonimba! - Fix FormikHelper and FieldHelperProps typesv2.4.2Compare Source
Patch Changes
96280d3#3817 Thanks @probablyup! - Updated internal types to support React 18.v2.4.1Compare Source
Patch Changes
2b194c2#3808 Thanks @NagaiKoki! - fix type of setFieldValue function708bcb2#3813 Thanks @probablyup! - RevertFieldArray"shouldComponentUpdate" performance optimization. As it turns out, it's a common use case to have JSX controlled via non-Formik state/props inside ofFieldArray, so it's not safe to cancel re-renders here.187e47d#3815 Thanks @probablyup! - Revert Yup transform support for the time being, this may be re-introduced in a future release under an opt-in prop.v2.4.0Compare Source
Minor Changes
2f53b70#3796 Thanks @probablyup! - Add support for Yup "transforms".v2.3.3Compare Source
Patch Changes
f075a0c#3798 Thanks @probablyup! - Fixed the use of generics for theArrayHelperstype such thatany[]is the default array type and for each individual method the array item type can be overridden if necessary.v2.3.2Compare Source
Patch Changes
f086b5a#3237 Thanks @pieplu! - ChangedgetInto return undefined when it can't find a value AND a parent of that value is "falsy" ( "" / 0 / null / false )6d8f018#3792 Thanks @probablyup! - Update the type forsetFieldValueto reflect the returnedPromiseand potential returned error(s).v2.3.0Compare Source
Minor Changes
73de78d#3788 Thanks @probablyup! - Added typescript generics toArrayHelpersinterface and its methods so that users who use TypeScript can set the type for their arrays and have type safety on array utils. I have also gone ahead and made supplying a type for the generic optional for the sake of backwards compatibility so any existing TS code that does not give a type for the FieldArray will continue to work as they always have.39a7bf7#3786 Thanks @probablyup! - Yup by default only allows for cross-field validation within thesame field object. This is not that useful in most scenarios because
a sufficiently-complex form will have several
yup.object()in theschema.
However, Yup offers something called
contextwhich can operate acrossthe entire schema when using a \$ prefix:
With this change, you may now validate against any field in the entire schema,
regardless of position when using the \$ prefix.
v2.2.10Compare Source
Patch Changes
22e236e#3784 Thanks @probablyup! - Improve performance of theFieldArraycomponent by adding ashouldComponentUpdatecheck; this should help avoid unnecessary re-renders which may affect the performance of a form.bc9cb28#3785 Thanks @probablyup! - Fixed field error state for array fields that have an error and become empty through an API likearrayHelpers.remove.The prior behavior resolved the field error to
[undefined], now it is simplyundefined.9cbf150#3787 Thanks @probablyup! - Fix infinite loop issue inFieldwhen field helpers (setTouched, etc) are used as an argument inReact.useEffect.9c75a9f#3780 Thanks @probablyup! - Fixed an issue with array field errors being incorrectly split into an array of individual characters instead of an array of error strings.35fa4cc#3783 Thanks @probablyup! - Fix validation of deep.dot.path field references when using thevalidateFieldAPI.v2.2.9Compare Source
Patch Changes
ca60ef9#3227 Thanks @johnrom! - Bump lodash and lodash-es to latest versions.v2.2.8Compare Source
Patch Changes
3a9c707#3203 Thanks @hixus! - Fixes type of setError value as it is same as setFieldError messagev2.2.7Compare Source
Patch Changes
e50040a#2881 Thanks @jinmayamashita! - Prevent calling getSelectedValues when the element has not options31405ab#3201 Thanks @artola! - Fixes regression that resulted in error update race condition from when usingvalidateOnMountc2d6926#2995 Thanks @johnrom! - Allow explicitly setting<form action>to empty string (#2981). Note: previous code which passed an empty string would result in a noop (simply appending # to the url), but this will now result in a form submission to the current page.v2.2.6Compare Source
Patch Changes
d4314a1#2955 Thanks @jkbktl! - fix(docs): fix link to docs in console warningv2.2.5Compare Source
Patch Changes
ebad985#2891 Thanks @jaredpalmer! - Remove low-priority validation implementation0dfa23b#2889 Thanks @jaredpalmer! - Fixed botched typescript builds including scheduler typesv2.2.4Compare Source
Patch Changes
199e77a#2882 Thanks @umidbekkarimov! - ValidatesetFieldTouchedwith high priorityv2.2.3Compare Source
Patch Changes
e0a28e6#2867 Thanks @umidbekkarimov! - Fix low priority validation for browser password autofill.958d67c#2874 Thanks @maddhruv! - fix FastField initial value when input type is radio or checkboxv2.2.2Compare Source
Patch Changes
00f95ec#2854 Thanks @umidbekkarimov! - Fix low priority validation race condition.v2.2.1Compare Source
Patch Changes
e04886d#2820 Thanks @wellyshen! - Fixed bug with scheduler andvalidateFormWithLowPrioritymethod not be scheduled correctlyv2.2.0Compare Source
Minor Changes
4148181#2794 Thanks @jaredpalmer! -setValuecan now optionally accept a function as a callback, exposingReact.SetStateActionfunctionality. Previously, only the entire object wasallowed which caused issues with stale props.
v2.1.7Compare Source
Patch Changes
bda9f41#2785 Thanks @jaredpalmer! - Replace all instances of the deprecated React.SFC type with React.FCv2.1.6Compare Source
v2.1.5Compare Source
Bugfixes
prepareDataForValidation. (#2265)LowPriorityfromschedulerinnerReftype signature (#2325)handleChange/handleBlurtypings (#2472)@typescript-eslint/unbound-methodwarning.Internal
Legal
Commits
prepareDataForValidation. (#2265)v2.1.4Compare Source
v2.1.3Compare Source
Patches
8f998aeinitialValuesand avaluewasn't specified at /. Now we are nicer about it, and set the nextvaluetotrueinstead of throwing.67ff9704ff1c5cCredits
Huge thanks to @mackness, @JanCizmar, @is2ei, @leonvisscher, @stephan281094, and @brentvatne for helping!
v2.1.2Compare Source
Patches
587c5ee7173d744b230097f00fd69c1b0d0validate: #2195Credits
Huge thanks to @BjoernRave, @emrosenf, @kristenmills, @dremex, @zachintosh, @deini, @brunohkbx, @Menardi, @gwn, @fabb, and @jamesmosier for helping!
v2.1.1Compare Source
Patches
d1059c8valuewas not specified on a checkbox as well as when there is just one checkbox.FieldArrayto use latest values for validation: #2166Credits
Huge thanks to @wallymathieu, @eliamaino-fp, and @mrmuhammadali for helping!
v2.1.0Compare Source
Minor Changes
Add
FieldHelpersobject to the array returned byuseField: #2124. Thisexposes three helper functions to allow you to imperatively change the
field in question:
setValue(value: any)setTouched(value: boolean)setError(value: string)Before
After
Credits
Huge thanks to @drivasperez for helping!
v2.0.11Compare Source
Patches
Credits
Huge thanks to @viniciusdacal for helping!
v2.0.10Compare Source
TS Patch
useField<T>generic.v2.0.9Compare Source
Patches
v2.0.8Compare Source
Patches
v2.0.7Compare Source
Improvements
shouldComponentUpdateby refactoring the component away from usingstatic contextTypeand back to using theconnect()higher order component.Bug fixes
Fixed regression where
dirtyis wasn't re-evaluated afterresetForm()Fixed regression where handleChange would explode when event.target didn't exist (e.g. event.currentTarget
If there are validation errors while calling
submitForm(), the promise will now rejects with errors (and of course abort the submit). Previously, it would abort the submit and resolve. The nuance is hard to describe so here is the difference.Before (2.0.6)
After (2.0.7)
2.0.6: https://codesandbox.io/s/gracious-noether-bu8u6
2.0.7: https://codesandbox.io/s/objective-perlman-jxhuq
Commits
17d82bcec1d679c5ec7092b6f71e39bfbfb5c59dbef4ff0289da328837870bf4ac6186v2.0.6Compare Source
Bugfix
Promise<any>. This allows folks to return a promise that returns something (which is pretty common). Sorry about that folks.Commits
e933b9c67e90712738bbcv2.0.5Compare Source
Bugfixes
onSubmitbehavior to mimic v1 if the function is synchronous. This means fixes a bug whereisSubmittingwas never toggled. To summarize: IfonSubmitis async, then Formik will automatically setisSubmittingtofalseon your behalf once the submission is completed. This means you do NOT need to callformikBag.setSubmitting(false)manually in v2. HOWEVER, if youronSubmitfunction is synchronous (e.g. v1), then you need to still callsetSubmitting(false)on your own. (#1987)validateFormWithLowPrioritywith to use fresh values (#2025)Commits
a78bbff430f6ccaf0c7d0d0d7602b04a7628dbaabaisSubmittingbehaviour to mimic v1 (#1987)3ce6551c0fe1b9e386371eb2029dd78266f0f54fb8aa7fbdbd0b5b0702c303f5916ac055cbfd38c08a6328c92424b52d26189256d11a4bee7940feev2.0.4Compare Source
Bugfixes
prepareDataForValidationwork with instances (#1949)ec7810a. this fixed a regression where people were having issues when keeping wonky objects likeMoment()as values.schedulerdep.Internal
Commits
5bae8e05553720343c4ee86b61bb7fc52e1828619082775faFormikActionsrename toFormikHelpers(#1988)f80d9c676ec8dea4ebf84a2b66c5d90149e56c0a80.min()method tomax()(#1959)654b97fe2c2d08e5c8ee13638853ec7810a53585cd1992123db41f4c079363894b066c8be2e5d34e3867cbd56815963a8dcd985c882f61d57882f3d2a56add5d3a268v2.0.3Compare Source
Bugfixes
<Form>due to omitted 2nd generic toReact.forwardRef. TypeScript users should use this version.Commits
e72db8a8ed4418428eff2e2c9c04bc9bc32547dbedv2.0.2Compare Source
Bugfixes
useFieldso that it returns a tupleCommits
edf49767b0752a49254b842cc3330517c8c6b220c0c16fbc4v2.0.1Compare Source
Formik 2 Migration Guide
Breaking Changes
Minimum Requirements
unknowntype, you must be on TypeScript 3.0 or higherresetFormThere is only one tiny breaking change in Formik 2.x. Luckily, it probably won't impact verry many people. Long story short, because we introduced
initialErrors,initialTouched,initialStatusprops,resetForm's signature has changed. It now accepts the next initial state of Formik (instead of just the next initial values).v1
v2
What's New?
Checkboxes and Select multiple
Similarly to Angular, Vue, or Svelte, Formik 2 "fixes" React checkboxes and multi-selects with built-in array binding and boolean behavior. This was one of the most confusing things for people in Formik 1.x.
useField()Just what you think, it's like
<Field>, but with a hook. See docs for usage.useFormikContext()A hook that is equivalent to
connect().<Field as><Field/>now accepts a prop calledaswhich will injectonChange,onBlur,valueetc. directly through to the component or string. This is useful for folks using Emotion or Styled components as they no longer need to clean upcomponent's render props in a wrapped function.Misc
FormikContextis now exportedvalidateOnMount?: boolean = falseinitialErrors,initialTouched,initialStatushave been addedgetFieldProps(nameOrProps)There are two useful additions to
FormikProps,getFieldPropsandgetFieldMeta. These are Kent C. Dodds-esque prop getters that can be useful if you love prop drilling, are not using the context-based API's, or if you are building a customuseField.getFieldMeta(name)Given a name it will return an object:
Configuration
📅 Schedule: Branch creation - "every weekend" in timezone US/Eastern, Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.