jaredpalmer / jaredpalmer/formik

onChange handler doesn't work with withFormik

Open
#1,817 2 comments 5 reactions 0 assignees View on GitHub
stale
Dominant language
TypeScript
Stars
34.3k
Forks
2.8k
PR merge metrics
No merged PRs in 30d

Description

## 🐛 Bug report

### Current Behavior

When using withFormik, the handleChange function is not called when passed in via props. However, the input onChange event will call a local change handler function.

### Expected behavior

handleChange function from props should be called

### Reproducible example

https://codesandbox.io/embed/withformik-codesandbox-template-xolcc

### Your environment

| Software | Version(s) |
| ---------------- | ---------- |
| Formik | 1.5.8
| React | 16.8.6
| TypeScript |
| Browser |
| npm/Yarn |
| Operating System | macOS

Contributor guide

Open the contributing guide

Research direction

Start with the linked CodeSandbox reproduction and trace the withFormik entry point, comparing the prop-supplied handleChange path with the local input onChange handler. Done means the handleChange function passed through props is called when the input changes, while the reproduction continues to behave as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.