Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Building Performant Forms in React with over 100 fields #800

Open
devarsh opened this issue Mar 25, 2020 · 0 comments
Open

Building Performant Forms in React with over 100 fields #800

devarsh opened this issue Mar 25, 2020 · 0 comments

Comments

@devarsh
Copy link

devarsh commented Mar 25, 2020

Hi,
One thing that really bothers me is when i'm building forms with react is that if you want your forms to have features such as watchers, dependent values, you have to store the form state in context and have your fields subscribe to the context and react to cross-field changes, now since you're using context, upon every update to your state stored in context all the fields would be rerendered, and there is no escape from that, yes for performance you can use shouldComponentUpdate or memoization with a custom updater, and now you have to make sure your custom updater takes into account all the fields mutations that are important to you, it still feels a hacky way of doing things.

So I was wondering if there are any approaches you've taken which might skip context, perhaps a pub-sub model, and tracking object mutations and triggering updates and only update the required fields.

If you've any thoughts or ideas I would like to hear.

I've made the hacky react way dynamic form but still is not the ideal solution: https://github.com/devarsh/miniApps/tree/master/wordTemplate/ux

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

No branches or pull requests

1 participant