You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a parent component which displays multiple tabs and a table with entries. Which tab is currently selected is kept in the state of the parent component (activeTab). The data and columns objects for the react-table below are dependent on the currently active tab.
When I change the tab my parent component is rerendered, the memoized objects are reevaluated once, thus I expect my table to be rerendered as well. Somehow it is being rendered twice though which causes some performance issue if the table has many entries. I don't see why it would be rendered twice.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a parent component which displays multiple tabs and a table with entries. Which tab is currently selected is kept in the state of the parent component (
activeTab
). Thedata
andcolumns
objects for the react-table below are dependent on the currently active tab.When I change the tab my parent component is rerendered, the memoized objects are reevaluated once, thus I expect my table to be rerendered as well. Somehow it is being rendered twice though which causes some performance issue if the table has many entries. I don't see why it would be rendered twice.
It does have something to do with my memoized
data
andcolumn
, when I remove the dependencies from the useMemo-Array, the table is rendered only one.Beta Was this translation helpful? Give feedback.
All reactions