reflex icon indicating copy to clipboard operation
reflex copied to clipboard

Uncaught JS Error : Passing a var instead of event handler to an event_trigger

Open Lendemor opened this issue 3 years ago β€’ 0 comments

Describe the bug When you pass the wrong kind of argument to an event trigger (var instead of event handler), it result in a runtime JS error instead of compilation python error.

To Reproduce Steps to reproduce the behavior:

class State(pc.State):
    some_var: bool

def index():
    return pc.box(pc.icon(tag="AddIcon", on_click=State.some_var))

Expected behavior Compilation should catch this error and throw a Python traceback to identify the problem

Screenshots image

** Specifics (please complete the following information):**

  • Python Version: 3.10
  • Pynecone Version: 0.1.13
  • OS: Ubuntu 22.04
  • Browser (Optional): Chrome

Lendemor avatar Jan 22 '23 15:01 Lendemor