Skip to content

Slow startup time on forms with many inputs #471

@felixmosh

Description

@felixmosh

I have a large form (100+ checkboxes) on one of my pages, it takes more then 3 sec to initial render it. After the initial render it works properly.
I've checked what make it stuck, and looks like that the attachToForm method which each input is calling on mount and it triggers validation for each insert, maybe it is better to debounce the call for form.
attachToForm -> validate(Input) (which calls to setState) -> validateForm (which calls to setState)

This chain of calls means that there are many formValidation (Arithmetic progression) which is redundant, cause onMount of the form it self there another call for validateForm

image
My test page: https://codesandbox.io/s/awesome-taussig-2c1c4

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions