Event types are not checked when some arguments are bound and some are not. In the cases of arguments with defaults it's even more confusing.
"""App for testing."""
import reflex as rx
class State(rx.State):
@rx.event
def on_submit(self, arg1: int, arg2: str = "default"):
"""Handle the submit event."""
print(f"Submit called with {arg1} and {arg2}")
def index():
return rx.form(rx.button("Submit"), on_submit=State.on_submit(1))
app = rx.App()
app.add_page(index)
Here it prints a dict for arg2, instead of "default".
Event types are not checked when some arguments are bound and some are not. In the cases of arguments with defaults it's even more confusing.
Here it prints a dict for arg2, instead of "default".