deephaven / deephaven-plugins

Deephaven Plugins
5 stars 12 forks source link

ReactPanel - ErrorBoundary key prop is causing unnecessary re-mount #573

Closed bmingles closed 1 week ago

bmingles commented 2 weeks ago

The ErrorBoundary inside of ReactPanel is causing mount / unmount any time children changes. This is causing some flickering / re-rendering whenever state changes in a ui component.

Minimal reproduction (click the button to see table flicker)

from deephaven import empty_table, ui

_simple_static = empty_table(2000).update_view([
    "String=new String(`a`+i * 1000)",
])

@ui.component
def ui_flicker():
    value, set_value = ui.use_state()

    def on_click():
        set_value('flicker') 

    return ui.button(
        "Flicker",
        on_press=on_click
    ), _simple_static

my_flicker = ui_flicker()