Skip to content

Bug: Remove Synthetic Events #36419

@nihil-pro

Description

@nihil-pro

Please, remove synthetic events, and start with platform ones.

Synthetic events were a mistake from the start, but now – they're a developer headache. In addition to other known problems of React synthetic events – they violate platform (browsers) API, which is unacceptable at all, ant that – violation of platform API – is the primary reason to remove them totally.

React version: all

Why synthetic events were a mistake from the start?
Because when React appeared, most of cross-browser issues were already solved, and W3C DOM Level 3 Event specifications were standardized. A simple wrapper would be much better and safer, like:

function eventDecorator(event) {
  if (!Object.hasOwnProperty(event, 'target')) {
    Object.defineProperty(event, 'target', {
      get() {
        return this.srcElement;
      }
    })
  }
  // ...etc
}

but instead, we have proprietary synthetic events. Nothing more that a vendor-lock, expect bugs and headache.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    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