Skip to content

docs(wrapping-react): remove broken EventHandler import in props example#6714

Open
anxkhn wants to merge 1 commit into
reflex-dev:mainfrom
anxkhn:patch-8
Open

docs(wrapping-react): remove broken EventHandler import in props example#6714
anxkhn wants to merge 1 commit into
reflex-dev:mainfrom
anxkhn:patch-8

Conversation

@anxkhn

@anxkhn anxkhn commented Jul 7, 2026

Copy link
Copy Markdown

The "Event Handlers" example in docs/wrapping-react/props.md starts its Python
code block with:

from reflex.vars.event_handler import EventHandler

There is no reflex.vars.event_handler module (reflex/vars/ only contains
base, color, datetime, dep_tracking, function, number, object, and
sequence), so a reader copying the snippet hits an immediate error:

ModuleNotFoundError: No module named 'reflex.vars.event_handler'

The imported EventHandler symbol is also unused in the example: the block
defines its event handlers with rx.EventHandler[...], never the bare
EventHandler. The line is therefore both broken and dead, so this PR simply
removes it. The other two imports in the block (from reflex.vars.function import FunctionVar and from reflex.vars.object import ObjectVar) are valid and left
untouched.

If an explicit EventHandler import were ever wanted here, the canonical path is
from reflex.event import EventHandler, but the example does not need it.

Type of change

  • This change requires a documentation update (documentation-only fix)

All Submissions:

  • Have you followed the guidelines in CONTRIBUTING.md?
  • Have you checked that there aren't other open PRs for the same change?
    (Searched open and closed PRs for reflex.vars.event_handler,
    wrapping-react EventHandler import, and props.md; none found.)

Verification

No doc-snippet execution/doctest harness runs this Markdown, so there is no
automated regression surface. Verified manually under the project venv:

$ python -c "from reflex.vars.event_handler import EventHandler"
ModuleNotFoundError: No module named 'reflex.vars.event_handler'   # before

$ python -c "from reflex.vars.function import FunctionVar; from reflex.vars.object import ObjectVar"
# succeeds  (the imports kept in the example)

Lint/format clean on the changed file:

$ ruff check docs/
All checks passed!
$ ruff format --check docs/wrapping-react/props.md
1 file already formatted

The Event Handlers example imported `EventHandler` from
`reflex.vars.event_handler`, a module that does not exist, so copying the
snippet raised `ModuleNotFoundError`. The imported symbol was also unused in
the example (the block references `rx.EventHandler`). Drop the dead import;
the remaining `FunctionVar` and `ObjectVar` imports are valid and used.

Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
@anxkhn anxkhn requested review from a team and Alek99 as code owners July 7, 2026 08:18
@greptile-apps

greptile-apps Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Removes a single broken import line from the "Event Handlers" code example in docs/wrapping-react/props.md. The reflex.vars.event_handler module does not exist, so any reader copying the snippet would hit an immediate ModuleNotFoundError; the imported symbol was also never referenced in the example.

  • Removes from reflex.vars.event_handler import EventHandler — a non-existent import that is also unused in the surrounding code block.
  • The two remaining imports (FunctionVar from reflex.vars.function and ObjectVar from reflex.vars.object) are valid and untouched.

Confidence Score: 5/5

Documentation-only fix; removes a single dead import line with no runtime impact on the library itself.

The change removes one line from a Markdown code example. The deleted import pointed to a module that does not exist in the codebase and was unused in the snippet, so the fix is straightforwardly correct and there is no risk of regression.

No files require special attention.

Important Files Changed

Filename Overview
docs/wrapping-react/props.md Removes one broken from reflex.vars.event_handler import EventHandler import from a code example; the module does not exist and the symbol was unused in the snippet.

Reviews (1): Last reviewed commit: "docs(wrapping-react): remove broken Even..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant