Skip to content

Commit fc47f6c

Browse files
authored
fix default argument in decentralized event handler example (#1414)
* fix default argument in decentralized event handler example * upgrade lock
1 parent b556323 commit fc47f6c

File tree

3 files changed

+288
-284
lines changed

3 files changed

+288
-284
lines changed

docs/events/decentralized_event_handlers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ class MyState(rx.State):
2424
count: int = 0
2525

2626
@rx.event
27-
def increment(state: MyState, amount: int = 1):
27+
def increment(state: MyState, amount: int):
2828
state.count += amount
2929

3030
def decentralized_event_example():
3131
return rx.vstack(
3232
rx.heading(f"Count: {MyState.count}"),
3333
rx.hstack(
34-
rx.button("Increment by 1", on_click=increment()),
34+
rx.button("Increment by 1", on_click=increment(1)),
3535
rx.button("Increment by 5", on_click=increment(5)),
3636
rx.button("Increment by 10", on_click=increment(10)),
3737
),

rxconfig.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212
show_build_with_reflex=False,
1313
telemetry_enabled=False,
1414
tailwind=tw_config,
15+
plugins=[rx.plugins.TailwindV3Plugin()],
1516
)

0 commit comments

Comments
 (0)