8000 Add FieldProps change to v2 migration guide by mhelmer · Pull Request #2356 · jaredpalmer/formik · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add FieldProps change to v2 migration guide #2356

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

Merged
merged 3 commits into from
Apr 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations 8000
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/migrating-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ resetForm({ values: nextValues /* errors, touched, etc ... */ });

### Typescript changes

#### `FormikActions`

**`FormikActions` has been renamed to `FormikHelpers`** It should be a straightforward change to import or alias the type

**v1**
Expand All @@ -56,6 +58,22 @@ import { FormikActions } from 'formik';
import { FormikHelpers as FormikActions } from 'formik';
```

#### `FieldProps`

**`FieldProps` now accepts two generic type parameters.** Both parameters are optional, but `FormValues` has been moved from the first to the second parameter.

**v1**

```tsx
type Props = FieldProps<FormValues>;
```

**v2**

```tsx
type Props = FieldProps<FieldValue, FormValues>;
```

## What's New?

### Checkboxes and Select multiple
Expand Down
18 changes: 18 additions & 0 deletions packages/formik/MIGRATING-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ resetForm({ values: nextValues /* errors, touched, etc ... */ });

### Typescript changes

#### `FormikActions`

**`FormikActions` has been renamed to `FormikHelpers`** It should be a straightforward change to import or alias the type

**v1**
Expand All @@ -51,6 +53,22 @@ import { FormikActions } from 'formik';
import { FormikHelpers as FormikActions } from 'formik';
```

#### `FieldProps`

**`FieldProps` now accepts two generic type parameters.** Both parameters are optional, but `FormValues` has been moved from the first to the second parameter.

**v1**

```tsx
type Props = FieldProps<FormValues>;
```

**v2**

```tsx
type Props = FieldProps<FieldValue, FormValues>;
```

## What's New?

### Checkboxes and Select multiple
Expand Down
0