Skip to content
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

onSubmit handler has Proxy object as first argument #8869

Closed
gsingh93 opened this issue Jan 26, 2017 · 2 comments
Closed

onSubmit handler has Proxy object as first argument #8869

gsingh93 opened this issue Jan 26, 2017 · 2 comments

Comments

@gsingh93
Copy link

gsingh93 commented Jan 26, 2017

Do you want to request a feature or report a bug?
I believe this is a bug, since I can't find any documentation on this behavior changing.

What is the current behavior?
When calling a submit handler like onSubmit, the first argument is a Proxy object and the second argument is an Event object.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/reactjs/69z2wepo/).
https://codepen.io/anon/pen/zNEGpw?editors=0010

(see the console to see both objects)

What is the expected behavior?
The first argument should be an Event object, not a Proxy object.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
This is happening in react 15.4.1 and 15.4.2. It is not happening on 15.3.1.

@gaearon
Copy link
Collaborator

gaearon commented Jan 26, 2017

You should use the first argument to the event handler, just like in the docs.
The fact that it appears as "Proxy" shouldn't worry you—that's implementation detail.

I’m not sure why the second one exists: it’s likely a bug (and maybe even fixed in master, @aweary might remember).

@aweary
Copy link
Contributor

aweary commented Jan 26, 2017

The second event was just the result of an internal implementation detail with invokeGaurdedCallback. This was resolved in #8363 and should likely be released in the next minor version.

@aweary aweary closed this as completed Jan 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants