jaredpalmer / formik

Build forms in React, without the tears 😭
https://formik.org
Apache License 2.0
33.77k stars 2.78k forks source link

perf(FieldArray): add shouldComponentUpdate to cut down on unnecessary renders #3784

Closed quantizor closed 1 year ago

quantizor commented 1 year ago

Closes #3295

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
formik-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 26, 2023 6:09pm
codesandbox-ci[bot] commented 1 year ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 2f2a60f09d31cd5d4c431169a1d37d76a5e3fc01:

Sandbox Source
Formik TypeScript Playground Configuration
JannesMeyer commented 1 year ago

@jaredpalmer @probablyup maybe this should've been a breaking change?

It broke our code because we have local state (a boolean popup toggle) that affects the FieldArray children.

quantizor commented 1 year ago

@jaredpalmer @probablyup maybe this should've been a breaking change?

It broke our code because we have local state (a boolean popup toggle) that affects the FieldArray children.

If you could provide a failing test/reproduction to work from in a new issue and tag me that would be appreciated

xconverge commented 1 year ago

I also experienced breakage.

Adding this for now restored behavior. shouldUpdate={() => true}

I will look at the logic a bit more in this PR to see if I can find a clue