-
Notifications
You must be signed in to change notification settings - Fork 47.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TestUtils] Implement type property in Simulate.<eventName> #6154
Conversation
Although it is unreasonable to set every possible property for simulated events, `type` is useful for event handlers that are shared between types and potentially have different behaviors.
Thanks for contributing! I’m closing because I think this should already be possible for any property, so there is no need to add a special support for Cheers. |
You shouldn't have to though. That's why I sent the PR. If you're using the shorthand, the simulator should be smart enough to set it.
|
Yeah perhaps you’re right. Since we’re setting Should this line have the same addition too for consistency? I don’t know this code well so can’t say. I’ll defer to @zpao on whether we want this. |
@gaearon The tests don't break without that other line, so |
Yeah but you’re not using SimulateNative, are you? I’m not sure who’s using it because it’s undocumented but quite extensive. Maybe Facebook uses it internally; I haven’t checked. |
@gaearon Yes that's true, I've only ever used |
@gaearon anything else you want me to do here? |
Let’s get it in, don’t see any harm in this. 👍 |
Although it is unreasonable to set every possible property for simulated events, `type` is useful for event handlers that are shared between types and potentially have different behaviors. (cherry picked from commit 5a20d44)
Hi all, I've encountered a few errors in a few external apps (react-select is a public-facing one) due to mutating the event type with the |
Although it is unreasonable to set every possible property for simulated events,
type
is useful for shared event handlers that have different behaviors.Closes #6100