Skip to content
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

Fix unnecessary rendering of FastField #2070

Merged
merged 2 commits into from
Dec 6, 2019

Conversation

mvestergaard
Copy link
Contributor

@mvestergaard mvestergaard commented Nov 26, 2019

Whenever Context changes, shouldComponentUpdate is not called, which caused FastField to always re-render whenever Context changes
This adds a wrapper around FastField that grabs the Context, and passes it down as props

Fixes #1974, #2042, #1759

May depend on #2069 to be entirely fixed

@vercel
Copy link

vercel bot commented Nov 26, 2019

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/jared/formik-docs/k0mxso22i
🌍 Preview: https://formik-docs-git-fork-mvestergaard-fastfield-fix.jared.now.sh

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 26, 2019

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 5da4bf3:

Sandbox Source
Formik TypeScript Playground Configuration
billowing-violet-psjez Issue #1974
frosty-booth-v9r4r Issue #1974

@mvestergaard
Copy link
Contributor Author

I tried my best to write a test that reproduces the problem, but it's really difficult, if not impossible in a "fake context".
Use the FastField story in the formik storybook to compare the behavior to before.

Whenever Context changes, shouldComponentUpdate is not called, which caused FastField to always re-render whenever Context changes
This adds a wrapper around FastField that grabs the Context, and passes it down as props
src/FastField.tsx Outdated Show resolved Hide resolved
@mvestergaard
Copy link
Contributor Author

@jaredpalmer Can you take another look at this please? And possibly publish a new release including this and #2069
Large forms are presently close to unusable

@jaredpalmer
Copy link
Owner

Publishing meow

@jaredpalmer jaredpalmer merged commit 2b6f71e into jaredpalmer:master Dec 6, 2019
@mhaylock
Copy link

mhaylock commented Dec 9, 2019

@jaredpalmer what is the status of that release?

I went to look for the release attached to your comment above but I see the last release was 2.0.6, 17 days ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance issues in v2
3 participants