Callback gets activated when app starts

Hello! I have a button and a div, the div should be activated when “button.n_clicks” changes, but when the app starts the div gets updated despite the button has not been clicked. Is there any way to get rid of this issue?

thanks for reading!

You can set prevent_initial_call=True inside your callback. Here is the doc link for reference.

1 Like