Open JulienPathtech opened 1 year ago
@ericboucher @JulienPathtech. Some thoughts on the performance optimization:
Layers
are being created through a createElement
React function dynamically, we have to consider maybe changing that to a switch case block returning the specific components, because I am not really sure that the createElement is causing rerenders every time it is initialized.memo
wrapper function to the individual Layers
components in general to trigger shallow equality between the props that we are passing, maybe preventing the rerenders.memo()
with createElement
seems not the root cause of this extra rerendering. Also, I have no certainties that this refacto will improve performance.Linked to #1040
Prevent unnecessary layer rendering.
The
WMSLayers
component is rendered twice when we change date (selectedDate
of the WMSLayer for instance). One rendering is done with current date and an another one is triggered with a the newselectedDate
.How to reproduce :
WMSLayers
component should render twiceIs there anything else you can add about the proposal? You might want to link to related issues here, if you haven't already.
I reproduced this with WMSLayers but that might be the case with other layer type