Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Columns: Avoid re-render and subsequent action dispatch by adopting module constant #7720
We were passing a new allowedBlocks reference on each column render. This dispatch additional unnecessary further actions to update inner block settings.
This problem may cause noticeable lag when writing/using columns because updating the InnerBlock setting may cause another rerender and another rerender updates the settings again. So this change prevents cascade re-renders.
The alternative is comparing each element of the array to verify if it changed or not. But this has a performance impact and we should not pass new props during rerenders if the props did not change so I feel this is the correct approach.
How has this been tested?
I verified the columns block works as before and no unnecessary UPDATE_BLOCK_LIST_SETTINGS are being dispatched.