Skip to content

Keyword arguments are not supported for Events #6495

@bertbarabas

Description

@bertbarabas

Describe the bug
When yielding a server event with a keyword argument from a server event, the type checker complains with:

Unexpected keyword argument `tries` in function `reflex_base.event.EventCallback.__call__`

To Reproduce
Just paste the code below into your code editor with type checking enabled and note the underlined keyword as shown in the screen shot.

  • Code:
import reflex as rx


class MyState(rx.State):
    @rx.event
    def do_something(self, tries=1):
        # yield something to client
        if tries > 0:
            yield MyState.do_something(tries=tries - 1)

Expected behavior
There should not be any type check errors

Screenshots

Image

Specifics:

  • Python Version: 3.14
  • Reflex Version: 0.9.2
  • OS: Ubuntu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions