Skip to content

Document simulating browser events #352

@gaearon

Description

@gaearon

Maybe for the FAQ. It's commonly asked how to simulate events in React. We have Simulate helpers but they only trigger the React events without the browser behavior. In some cases that's not enough. We also have SimulateNative helpers but they're undocumented and I think we should get rid of them (facebook/react#11656).

What we should do IMO is to document how to use browser APIs to dispatch normal browser events. Surprisingly many people have no idea (including myself a few weeks ago). For example: facebook/react#11111 (comment). (It's also commonly missed that the node needs to be in the document for this to work with React.)

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