Skip to content

How to wrap events in React 16 #11115

Closed
Closed
@tolmasky

Description

@tolmasky

Per the discussion from React 16 RC, I was asked to open a separate issue regarding opening up the event system in React. We currently use:

require("react-dom/lib/EventPluginUtils").executeDispatchesInOrder

But this disappeared in React 16, which is blocking our ability to upgrade to it.

Basically we grab executeDispatchesInOrder in order to wrap it so a certain piece of code can fire afterward. I was asked here why we don't just wrap addEventListener instead, and at least at the time, I believe my experiments showed that this didn't work because React seemed to firing its internal synthetic events at a later time (possibly batching them? I don't know). If there is a new hacky way to do this same thing, I'm happy to do that and punt on this question.

Do you want to request a feature or report a bug?
Depends, certainly used to work, so in that sense a bug, but would require API creation perhaps, so maybe a feature?

What is the current behavior?
No access to event firing.

What is the expected behavior?
Some way to inject code to fire after events fire.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React 16, solution existed in React 15 and down.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions