✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚾️ It's finally Baseball season! Root for the home team... & Register for our Sports Analytics Webinar!

Dash doesn't "see" Local JS update of dcc component?


I’m building a dash app and have a custom-js file in the assets folder. I use javascript to update a dash component (html.Div, id=‘name’) using:


Which seems to work perfectly on the app. The “name” div renders the data that I need. However, Dash doesn’t seem to “see” this change in the div properties.

Here is an example:

app.layout =
          html.Div(id='name', children='test'),

    Output('test_chart', 'chart'),
    [Input('btn', 'n_clicks')],
def display_hover_data(clicks,hover_data):

    return clicks

When I check the console what I would like to see is (“banana”, 1) and maybe (“apple”,2), etc. But the console always shows (“test”,2) then (“test”,3) and so on and so forth.

Could anyone help me understand why Dash is not “seeing” the changes in the value of the children properties of the “name” div?