I've got a MultiGrid that needs to be updated when the component is updated.
Calling cellMeasurerCache.clearAll()
and gridRef.current.forceUpdateGrids()
in shouldComponentUpdate
works.
Doing the same in componentDidUpdate
does not. I don't shouldComponentUpdate
to have side effects - any ideas why it doesn't work from componentDidUpdate
? @bvaughn
Could it be because shouldComponentUpdated
is happening before render
is called, while componentDidUpdate
happens afterwards?
Should my CellMeasurerCache
be part of the components state
?
3) If I resize the width of the window , and then I call these methods:
selectedConversation.cellMeasurerCache.clearAll();
selectedConversation.cellMeasurer.resetMeasurements();
selectedConversation.listRef.recomputeRowHeights();
selectedConversation.listRef.forceUpdateGrid();
after the resizing, it looks bad. but then if i scroll out of view, and then back in view, it looks nice and adjusted to the new width