react / react/react-strict-dom

(feature) EventTarget API on host elements

Open
#37 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cannot polyfill feature
Dominant language
JavaScript
Stars
3.6k
Forks
206
PR merge metrics
No merged PRs in 30d

Description

Describe the feature request

The EventTarget interface is implemented by objects that can receive events and may have listeners for them. Native does not currently support this API on host elements.

Previously we had introduced a prototype implementation of addEventListener and removeEventListener in React Native, but it was removed as it needs to be reimplemented properly and integrated with broader changes to React Native. For example, the events need to conform to W3C standards in terms of timing and event payload.

In the meantime, we may be able to polyfill this API using event emitters and the new traversal APIs, which would allow us to emulate capture/bubble phases of events. But, ideally we'd build this into React Native given it would be more performant and there is already an existing event system.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing EventTarget, addEventListener, and removeEventListener discussion, then review the event emitters, traversal APIs, and React Native event system mentioned in the issue. Determine whether the implementation should be a polyfill or integrated into React Native, including W3C-compatible timing, payloads, and capture/bubble behavior; done means host elements support the API consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.