✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐇 Announcing Dash VTK for 3d simulation graphics. Check out the March webinar.

dcc.Loading only on page load?

Hi, is it possible to use dcc.Loadig only when the page is loading ?

In my example code:

@app.callback(Output('page-content', 'children'),
              [Input('url', 'pathname')])
def display_page(pathname):
    if pathname == '/':
        return html.Div(dcc.Loading(loading_state={'is_loading':True},chidlren=[header,login]))

dcc.Loading is triggered every time a I use a slider or any dcc.component in the page, so I only want dcc.Loading fire on page load.

1 Like