Skip to content

Conversation

@BSd3v
Copy link
Contributor

@BSd3v BSd3v commented Jan 12, 2026

fixes #3330

fixes issue where components wouldnt remount when passed as a children prop
eg:

import dash_mantine_components as dmc
from dash import Dash, Input, Output, State, no_update, html
from dash_ag_grid import AgGrid
app = Dash()

test = [
    AgGrid(
        id="ag-grid",
        rowData=[
            {"number": 1, "text": "a"},
        ],
        columnDefs=[
            {"field": "number", "filter": "agNumberColumnFilter"},
            {"field": "text", "filter": "agTextColumnFilter"},
        ]
    )
]

app.layout = dmc.MantineProvider(
    [
        html.Div(
            test,
        id='data-entry'
        ),
        dmc.Button('reload layout', id='reload-btn'),
    ],
    id="mantine-provider",
    defaultColorScheme="auto",
)

@app.callback(
    Output('data-entry', 'children'),
    Input('reload-btn', 'n_clicks'),
)
def reload_data(n_clicks):
    if n_clicks:
        return test
    return no_update

if __name__ == "__main__":
    app.run(debug=True)

Running this in the current dash will result in the component keeping some state even though it should technically be unmounted and remounted.

@AnnMarieW
Copy link
Collaborator

I tried this and confirmed that it fixes the example app from #3497

Copy link
Contributor

@T4rk1n T4rk1n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💃

@T4rk1n
Copy link
Contributor

T4rk1n commented Jan 13, 2026

The redraw test show one less redraw after a click that might be a regression.

@BSd3v
Copy link
Contributor Author

BSd3v commented Jan 13, 2026

Yeah, I wasn't sure how this would perform with specifically that instance.

@AnnMarieW
Copy link
Collaborator

Do you think some apps are relying on the current behavior of holding the state, and this might be considered a breaking change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disappearing and Swapping Content in Dash v3

3 participants