Skip to content

FastField is rendering on every value change #1759

@thupi

Description

@thupi

🐛 Bug report

Current Behavior

The FastField component renders even though its another fields value that is being changed.

Expected behavior

FastField components should only rerender when its own value is changed.

Reproducible example

The very wired part of this bug is that this works as expected on codesandbox. However, when i make a new clean project using CRA it doesn't :-/

Codesandbox: https://codesandbox.io/s/formik-2-rwlhv
Clean CRA project: https://github.com/thupi/formik-fast-field-sample

Additional context

Look for the console.log messages in both of these samples i provided above. The CRA sample console.logs both fields on every change while codesandbox works as expected.

I Thought this was due to typescript so i tried with at clean js project too but made no difference.

Software Version(s)
Formik 2.0.0.rc-12
React 16.9.0
TypeScript 3.5.2
Browser Chrome
npm/Yarn Yarn 1.15.2
Operating System MacOS Mojave

Metadata

Metadata

Assignees

No one assigned

    Labels

    Focus: PerformanceEnhancing Field and Form performance / renderingstale

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions