An output can have only one callback. Consider the following callback that is supposed to switch the content of a div on the click of a button. I would like two buttons to control the area content. I know that the callback can have multiple inputs, but how can I distinguish which buttons have been clicked if I only have the n_clicks
property?
@app.callback(
Output('div', 'children'),
[
Input('button-1', 'n_clicks'),
Input('button-2', 'n_clicks'),
]
)
def switch_area(button_1_clicks, button_2_clicks):
...