@@ -38,7 +38,7 @@ def button():
38
38
html .div (
39
39
"button:" ,
40
40
html .button (
41
- {"id" : "counter-inc" , "on_click " : lambda _ : set_count (count + 1 )},
41
+ {"id" : "counter-inc" , "onClick " : lambda _ : set_count (count + 1 )},
42
42
"Click me!" ,
43
43
),
44
44
html .p ({"id" : "counter-num" , "data-count" : count }, f"Current count is: { count } " ),
@@ -293,7 +293,7 @@ def _render_todo_items(items, toggle_item):
293
293
"id" : f"todo-item-{ item .text } -checkbox" ,
294
294
"type" : "checkbox" ,
295
295
"checked" : item .done ,
296
- "on_change " : lambda _ , i = item : toggle_item (i ),
296
+ "onChange " : lambda _ , i = item : toggle_item (i ),
297
297
}),
298
298
)
299
299
for item in items
@@ -342,8 +342,8 @@ def on_change(event):
342
342
"type" : "text" ,
343
343
"id" : "todo-input" ,
344
344
"value" : input_value ,
345
- "on_key_press " : on_submit ,
346
- "on_change " : on_change ,
345
+ "onKeyPress " : on_submit ,
346
+ "onChange " : on_change ,
347
347
}),
348
348
mutation_status ,
349
349
rendered_items ,
@@ -413,8 +413,8 @@ async def on_change(event):
413
413
"type" : "text" ,
414
414
"id" : "async-todo-input" ,
415
415
"value" : input_value ,
416
- "on_key_press " : on_submit ,
417
- "on_change " : on_change ,
416
+ "onKeyPress " : on_submit ,
417
+ "onChange " : on_change ,
418
418
}),
419
419
mutation_status ,
420
420
rendered_items ,
@@ -508,7 +508,7 @@ def on_click(_):
508
508
html .button (
509
509
{
510
510
"id" : f"{ inspect .currentframe ().f_code .co_name } _btn" ,
511
- "on_click " : on_click ,
511
+ "onClick " : on_click ,
512
512
},
513
513
"Click me" ,
514
514
),
@@ -527,7 +527,7 @@ def on_click(_):
527
527
html .button (
528
528
{
529
529
"id" : f"{ inspect .currentframe ().f_code .co_name } _btn" ,
530
- "on_click " : on_click ,
530
+ "onClick " : on_click ,
531
531
},
532
532
"Click me" ,
533
533
),
@@ -546,7 +546,7 @@ def on_click(_):
546
546
html .button (
547
547
{
548
548
"id" : f"{ inspect .currentframe ().f_code .co_name } _btn" ,
549
- "on_click " : on_click ,
549
+ "onClick " : on_click ,
550
550
},
551
551
"Click me" ,
552
552
),
@@ -561,7 +561,7 @@ def custom_host(number=0):
561
561
562
562
return html .div (
563
563
{
564
- "class_name " : f"{ inspect .currentframe ().f_code .co_name } -{ number } " ,
564
+ "className " : f"{ inspect .currentframe ().f_code .co_name } -{ number } " ,
565
565
"data-port" : port ,
566
566
},
567
567
f"Server Port: { port } " ,
@@ -630,15 +630,15 @@ async def on_submit(event):
630
630
"data-username" : ("AnonymousUser" if current_user .is_anonymous else current_user .username ),
631
631
},
632
632
html .div ("use_user_data" ),
633
- html .button ({"className" : "login-1" , "on_click " : login_user1 }, "Login 1" ),
634
- html .button ({"className" : "login-2" , "on_click " : login_user2 }, "Login 2" ),
635
- html .button ({"className" : "logout" , "on_click " : logout_user }, "Logout" ),
636
- html .button ({"className" : "clear" , "on_click " : clear_data }, "Clear Data" ),
633
+ html .button ({"className" : "login-1" , "onClick " : login_user1 }, "Login 1" ),
634
+ html .button ({"className" : "login-2" , "onClick " : login_user2 }, "Login 2" ),
635
+ html .button ({"className" : "logout" , "onClick " : logout_user }, "Logout" ),
636
+ html .button ({"className" : "clear" , "onClick " : clear_data }, "Clear Data" ),
637
637
html .div (f"User: { current_user } " ),
638
638
html .div (f"Data: { user_data_query .data } " ),
639
639
html .div (f"Data State: (loading={ user_data_query .loading } , error={ user_data_query .error } )" ),
640
640
html .div (f"Mutation State: (loading={ user_data_mutation .loading } , error={ user_data_mutation .error } )" ),
641
- html .div (html .input ({"on_key_press " : on_submit , "placeholder" : "Type here to add data" })),
641
+ html .div (html .input ({"onKeyPress " : on_submit , "placeholder" : "Type here to add data" })),
642
642
)
643
643
644
644
@@ -685,13 +685,13 @@ async def on_submit(event):
685
685
"data-username" : ("AnonymousUser" if current_user .is_anonymous else current_user .username ),
686
686
},
687
687
html .div ("use_user_data_with_default" ),
688
- html .button ({"className" : "login-3" , "on_click " : login_user3 }, "Login 3" ),
689
- html .button ({"className" : "clear" , "on_click " : clear_data }, "Clear Data" ),
688
+ html .button ({"className" : "login-3" , "onClick " : login_user3 }, "Login 3" ),
689
+ html .button ({"className" : "clear" , "onClick " : clear_data }, "Clear Data" ),
690
690
html .div (f"User: { current_user } " ),
691
691
html .div (f"Data: { user_data_query .data } " ),
692
692
html .div (f"Data State: (loading={ user_data_query .loading } , error={ user_data_query .error } )" ),
693
693
html .div (f"Mutation State: (loading={ user_data_mutation .loading } , error={ user_data_mutation .error } )" ),
694
- html .div (html .input ({"on_key_press " : on_submit , "placeholder" : "Type here to add data" })),
694
+ html .div (html .input ({"onKeyPress " : on_submit , "placeholder" : "Type here to add data" })),
695
695
)
696
696
697
697
@@ -720,9 +720,9 @@ async def disconnect(event):
720
720
},
721
721
html .div ("use_auth" ),
722
722
html .div (f"UUID: { uuid } " ),
723
- html .button ({"className" : "login" , "on_click " : login_user }, "Login" ),
724
- html .button ({"className" : "logout" , "on_click " : logout_user }, "Logout" ),
725
- html .button ({"className" : "disconnect" , "on_click " : disconnect }, "disconnect" ),
723
+ html .button ({"className" : "login" , "onClick " : login_user }, "Login" ),
724
+ html .button ({"className" : "logout" , "onClick " : logout_user }, "Logout" ),
725
+ html .button ({"className" : "disconnect" , "onClick " : disconnect }, "disconnect" ),
726
726
html .div (f"User: { current_user } " ),
727
727
)
728
728
@@ -752,9 +752,9 @@ async def disconnect(event):
752
752
},
753
753
html .div ("use_auth_no_rerender" ),
754
754
html .div (f"UUID: { uuid } " ),
755
- html .button ({"className" : "login" , "on_click " : login_user }, "Login" ),
756
- html .button ({"className" : "logout" , "on_click " : logout_user }, "Logout" ),
757
- html .button ({"className" : "disconnect" , "on_click " : disconnect }, "disconnect" ),
755
+ html .button ({"className" : "login" , "onClick " : login_user }, "Login" ),
756
+ html .button ({"className" : "logout" , "onClick " : logout_user }, "Logout" ),
757
+ html .button ({"className" : "disconnect" , "onClick " : disconnect }, "disconnect" ),
758
758
html .div (f"User: { current_user } " ),
759
759
)
760
760
@@ -774,5 +774,5 @@ def on_click(event):
774
774
},
775
775
html .div ("use_rerender" ),
776
776
html .div (f"UUID: { uuid } " ),
777
- html .button ({"on_click " : on_click }, "Rerender" ),
777
+ html .button ({"onClick " : on_click }, "Rerender" ),
778
778
)
0 commit comments