jlaufer
jlaufer

Reputation: 177

How to create a Dash Callback without an output?

It is required for an output to have a callback in Dash, but what if you want to trigger events in the backend without having anything output on the frontend?

Upvotes: 1

Views: 1639

Answers (2)

jlaufer
jlaufer

Reputation: 177

Create an empty dummy html.div and set the Output to this div

@callback(
    Output('dummy_div', 'children', allow_duplicate = True),
    ...
)...

Upvotes: 0

JulianKarlBauer
JulianKarlBauer

Reputation: 287

Callbacks without output have long been requested from the community and are available from dash version 2.17.0 (2024-05-03) see changelog with fixes in version 2.17.1.

Upvotes: 1

Related Questions