I am using the similar button callback code as mentioned in the dash guide. But the problem I am facing is that the callback function is called automatically at the start , even when the button is not pressed. I need that function should only be called when the button is pressed.
Check if n_clicks==None
and then raise dash.exceptions.PreventUpdate()
Callbacks will always be fired at the start to keep everything consistent
1 Like