New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support reusing Layer instances #257
Comments
@austinhyde And we could optimize deck.gl pretty heavily when reusing layers, essentially bypassing change detection, and sublayer generation. (Especially if we call Would be very happy to see this as a PR or mark it as a prioritized ticket. It is mostly a question of the "lifecycle management" code being the most complex part of deck.gl, so this change should be carefully reviewed, and ideally be backed up with documentation clarifications as well as additional test cases to help make sure we don't break things. |
@gnavvy - do you want to try your hand at this? |
Looks like this won't be making it into v4.0. We've added new benchmarks ( Deprioritizing but keeping open. |
Closing, since listed in #83 |
In my application, I have a Map component that tracks viewport state and sets some common properties, and other components simply provide the deck.gl layers to display on the map:
However, this arrangement hits the "deck.gl sanity check - Matching layer is same" assertion every time the Map component is re-rendered without the parent component being re-rendered, as is the case when you pan or zoom the map. This is not exactly expected behavior, although the docs do hint at it.
Instead of requiring new layer instances, I believe a better approach would be to either clone the layer when this condition is detected, or change the underlying code to not rely on old/new layers being separate instances.
The text was updated successfully, but these errors were encountered: