For event driven applications, it is useful to be able to dynamically route to different paths.
@componentdefexample():
redirect_handler, set_redirect_handler=use_state(None)
defclick_event(e):
resp=check_some_api()
ifresp.status==501:
set_redirect_handler(navigate("/login_incorrect"))
elifresp.status==200:
set_redirect_handler(navigate("/login_successful"))
else:
set_redirect_handler(navigate("/login_error"))
returndiv(button({"onClick": click_event}), redirect_handler)This should be based on the react-router navigate component.
This feature might use our future use_messenger hook to handle redirection events.
For event driven applications, it is useful to be able to dynamically route to different paths.
This should be based on the react-router navigate component.
This feature might use our future
use_messengerhook to handle redirection events.