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

Return original submit event as second param #1172

Merged

Conversation

travisdahl
Copy link
Contributor

Reasons for making this change

See #1167

@@ -151,6 +151,7 @@ export default class Form extends Component {

onSubmit = event => {
event.preventDefault();
event.persist();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would we need to ever access the event asynchronously? Do you have a sample use case for that?

Copy link
Contributor Author

@travisdahl travisdahl Feb 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are going to pass the original event past this function you need to persist or you get react warnings and it passes a synthetic event, not the original event

@epicfaace
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants