Open
Description
Example app below. If the clientside callback is defined before the public callback the app crashes. If the order is reversed the app works as expected.
from dash import Dash, Input, Output, clientside_callback, dcc, html
from dash_auth import public_callback
app = Dash()
app.layout = html.Div(
[
dcc.Location(id="url"),
html.Div(id="clientside-callback-output"),
html.Div(id="public-callback-output"),
]
)
clientside_callback(
"function (pathname) {return `Hello ${pathname} from clientside callback!`;}",
Output("clientside-callback-output", "children"),
Input("url", "pathname"),
)
@public_callback(
Output("public-callback-output", "children"),
Input("url", "pathname"),
)
def public(pathname: str) -> str:
return f"Hello {pathname} from public callback!"
if __name__ == "__main__":
app.run(debug=True)
Metadata
Metadata
Assignees
Labels
No labels