question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[RENDERER] Block unnecessary condition and hide field renders

See original GitHub issue

Scope: Form renderer

Description Based on this discussion: https://github.com/data-driven-forms/react-forms/discussions/1015#discussioncomment-532730 we have found some performance degradations in massive forms (500+ fields). Altough performance in forms like these will be a bit worse, there is still room for improvement.

This effort will reduce the number of renders for some components and look at why the useFieldApi hook is not working properly with subscriptions when using conditions and field arrays.

Thanks, @thecodejack for testing the limits of the renderer.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
Hyperkid123commented, Mar 26, 2021

Good news. I think I was able to “optimize” the condition rendering triggers. Now we have 1000 (999 have conditions) fields but when we trigger condition, only dependent fields are subjected to re-renders and the condition is still working:

Screenshot from 2021-03-26 14-45-14

That results in much smoother rendering because it eliminates a lot of renders + the condition evaluation itself.

Edit: here is a preview condition-optimizations

1reaction
Hyperkid123commented, Mar 29, 2021

There is one mere performance issue with array fields specifically. So I’m gonna have to take a look at that as well. Plus there might be an issue in wizard forms, but we will test it probably today or tomorrow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

9 tricks to eliminate render blocking resources - LogRocket Blog
By reducing render blocking resources, you can shorten the critical rendering path and reduce page load times, thus improving UX and SEO.
Read more >
prevent content hidden with ng-hide from rendering on the ...
I'm somewhat new to angular and have a question about an element that briefly renders on the page before disappearing. I would like...
Read more >
5 Ways to Avoid React Component Re-Renderings
In this article, I have discussed 5 different methods to prevent unnecessary re-rendering in React components. Most of these solutions capitalize caching, and ......
Read more >
7 Ways to Implement Conditional Rendering in React ...
1. Using an if…else Statement ... An if…else statement will execute the actions contained in the if block when the condition is satisfied....
Read more >
Prevent form from rendering - DevExpress Support
For example, if you wish to hide an editor based on a condition, you can put your editor inside a cell template and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found