-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Description
- Use React Profiler. Click the settings gear button and under the "General" tab check "Highlight update when components render"
- In the multi or single select stories change the selection
- Observe that the entire table re-renders
This isn't a big deal for an example table but for any moderately sized table this is likely to be an issue. Memoizing all the things definitely makes the example harder to follow and while I haven't dug in very far there is probably a fair bit of extra work to optimize React renders (for example, the onClick and onKeyDown functions trigger re-renders as does the object passed into Avatar's badge slot).
Worth considering having an "optimized" example or if it's possible for useTableFeatures to be more optimal be default. Interestingly, the virtualized example does no re-render everything when selections change so perhaps there is a simple way to improve the defaults from useTableFeatures.
Reactions are currently unavailable