Releases: final-form/react-final-form
v6.4.0
As of React v16.13.0
, there has been a warning in React Final Form, Redux Form, and Formik. You can read @gaearon's explanation of it here: facebook/react#18178 (comment)
This release, in conjunction with [email protected]
, fixes this warning.
Technically, a peer dependency change should be a major, breaking change, but these two libraries are so tightly coupled, that I'm only making it a "minor" update. Shout at @erikras on Twitter if this upsets you.
Bug Fix
v6.3.5
Bug Fix
- Update
keepDirtyOnReinitialize
before initial values #706 final-form/final-form#311
v6.3.4
Bug Fixes
- Add data object to useField/Field #711
- Submit edge case fix #697 #695
- Add missing dirtyFieldsSinceLastSubmit to getters #688
Typing Fixes
v6.3.3
v6.3.2
v6.3.1
Bug Fixes
- Fixed decorators unsubscribe order #620 #618
- Fix issue with inline
isEqual
causing an infinite rerender loop #603 #517 - Lazy evaluation of form and field state #596
- Fix async act warning #581
- Pausing validation before unmount #595 #408
- Fixed bug with ignoring changes to
onChange
#572 #569 - Pass any additional props to custom component #565 #175
- Pass through
multiple
value to custom components #545 #544 - Cleanup
onBlur
dependencies #546 - Do not pass undefined type to input #548
Typing Fixes
- Fix useFormState and useField Flow types #630
- Add RenderableProps to FormRenderProps #575
- Fix typescript typings in FieldProps #619
- Fix
FormProps['decorators']
#629 - Pass FormValues type to Decorator #661
- FieldInputProps extends AnyObject #606
- Remove Omit from the typescript definitions #589
- Allow typed render props in TS #570
Build Fixes
- Remove the version #604
v6.3.0
New Features
- Support for Final Form's new
validating
flag. Requires[email protected]
. #541
Bug Fixes
v6.2.1
Whilst it could be argued that updating a peer dependency is a "breaking change" – and it would be if it were on a large third party library, like React – it is the opinion of the library author that, due to the tight coupling between final-form
and react-final-form
, such a change, especially just for type definitions, is acceptable, even in a "patch" release. Feel free to yell at @erikras on Twitter if you vehemently disagree.
Type Updates
- Updated to [email protected] to get typed FieldState ab2e970
v6.2.0
TypeScript fixes
- Use the same default for FormValues type in all declared types (#525)
- Replace empty object default type with any object (#526)
- Refactor getContext back to a simple context file (#524)
New Features
- Strongly typed field values (#530)
- Added tsx generic typings for Field, Form, and FormSpy components (#522)
For Typescript users, you can take advantage of JSX Generics, so you can specify the type of your form values or field value directly in the JSX call to Form
, Field
, or FormSpy
. For Form
, it will even infer the form values type if you provide initialValues
.
Behold this code:
interface MyValues {
firstName: string
lastName: string
}
const initialValues: MyValues = {
firstName: 'Erik',
lastName: 'Rasmussen'
}
const onSubmit = (values: MyValues) => {
ajax.send(values)
}
{/*
Typescript will complain if the type of initialValues is not
the same as what is accepted by onSubmit
*/}
<Form onSubmit={onSubmit} initialValues={initialValues}>
{({ handleSubmit, values }) => {
// 💥 Type of values is inferred from the type of initialValues 💥
return (
<form onSubmit={handleSubmit}>
{/* 😎 Field values are strongly typed using JSX generics 😎 */}
<Field<string> name="firstName" component={TextInput} />
<Field<string> name="lastName" component={TextInput} />
<Field<number> name="age" component={NumberInput} />
<button type="submit">Submit</button>
</form>
)
}}
</Form>
v6.1.0
New Features
Usage:
import { withTypes, Field } from 'react-final-form'
type MyValues = {
email: string,
password: string
}
const { Form } = withTypes<MyValues>()
<Form onSubmit={onSubmit}>
{({ handleSubmit, values }) => {
// values are of type MyValues
}}
</Form>