My page content is wrapped in a parent Loading component that gets triggered every time a change is made to the page. I only want this Loading component to be triggered on the initial page load only. How do I go about doing that?
AFAIK there is no simple way to do it for now… Here is a discussion that might be helpful, but I never tested it.
You could possibly do the following:
Generally on page load the callback is fired because the component is initialized not necessarily the input has a value. So check the ctx.triggered[‘value’]. If it’s none then do something, if it is a value then return dash.no_update. That will keep the callback from changing the output.
Another approach would be to create a dummy div somewhere on the page, with no contents, and set up your callback to to have an input from the children of that dummy div. Since the div will never have any children, the call back will only get triggered on page load and never again.
Hope that helps.
Thank you for the reply. I ended up going with this approach.