Skip to content

Releases: final-form/react-final-form

v6.4.0

30 Mar 19:51
v6.4.0
Compare
Choose a tag to compare

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

  • Silent initial field registration to avoid React warning #766 #751

v6.3.5...v6.4.0

v6.3.5

23 Jan 09:59
v6.3.5
Compare
Choose a tag to compare

Bug Fix

v6.3.4...v6.3.5

v6.3.4

22 Jan 08:44
v6.3.4
Compare
Choose a tag to compare

Bug Fixes

  • Add data object to useField/Field #711
  • Submit edge case fix #697 #695
  • Add missing dirtyFieldsSinceLastSubmit to getters #688

Typing Fixes

  • Add otherProp to FieldRenderProps interface #716 #398
  • Fix handleSubmit typings #715 #86
  • Improved type definition for Field #708
  • Added note about the return type of handleSubmit #681 #675

v6.3.3...v6.3.4

v6.3.3

19 Nov 10:53
v6.3.3
Compare
Choose a tag to compare

Typing Fixes

  • Revert "Fix typescript typings in FieldProps (#619)" #679

v6.3.2...v6.3.3

v6.3.2

19 Nov 09:31
v6.3.2
Compare
Choose a tag to compare

v6.3.1 introduced a bug. v6.3.2 fixes it.

Bug Fixes

  • Made lazy state getters enumerable #678 #677

v6.3.1...v6.3.2

v6.3.1

18 Nov 09:44
v6.3.1
Compare
Choose a tag to compare

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...v6.3.1

v6.3.0

19 Jun 10:46
v6.3.0
Compare
Choose a tag to compare

New Features

Bug Fixes

  • Fixed destroyOnUnregister bug #537
  • Use updated value for formatOnBlur format func #465

v6.2.1...v6.3.0

v6.2.1

14 Jun 13:29
v6.2.1
Compare
Choose a tag to compare

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

v6.2.0...v6.2.1

v6.2.0

14 Jun 09:18
v6.2.0
Compare
Choose a tag to compare

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...v6.2.0

v6.1.0

11 Jun 08:17
v6.1.0
Compare
Choose a tag to compare

New Features

  • Allowed swappable final-form APIs #520
  • 💥 Strongly typed form values for Flow and Typescript 💥 #516

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>

Edit Strongly Typed Form Values with 🏁 React Final Form

Housekeeping

  • Remove context export #515
  • Simplify slightly logic around keeping latest value in ref #513

v6.0.1...v6.1.0