Skip to content

Remove binding for nonexistent SyntheticDataTransfer class #151

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

Conversation

greglittlefield-wf
Copy link
Collaborator

@greglittlefield-wf greglittlefield-wf commented Nov 9, 2018

Problem

There's no SyntheticDataTransfer object in React JS; synthetic JS mouse events get passed the actual DataTransfer object.

Having this JS binding and typing the real DataTransfer object as it was causing dart2js errors that looked like:

Warning: 'gJ2' is used reflectively but not in MirrorsUsed. This will break minified code.
14:38:58.512 react_with_react_dom_prod.js:100 Uncaught Error: NoSuchMethodError: method not found: 'gJ2'

Solution

Remove the private JS binding, and use the native DataTransfer instead.

Testing

Trigger a react-dart onClick handler and verify it doesn't throw in checked mode.

  • pub serve example/test/
  • In both Dartium (checked mode) and Chrome (dart2js)

This was causing dart2js errors that looked like:

    Warning: 'gJ2' is used reflectively but not in MirrorsUsed. This will break minified code.
    14:38:58.512 react_with_react_dom_prod.js:100 Uncaught Error: NoSuchMethodError: method not found: 'gJ2'
Copy link
Collaborator

@aaronlademann-wf aaronlademann-wf left a comment

Choose a reason for hiding this comment

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

+1

@greglittlefield-wf greglittlefield-wf merged commit 48384dc into Workiva:master Dec 28, 2018
@robbecker-wf
Copy link
Member

+10 Verified no errors in Chrome or dartium (dart 1)

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

Successfully merging this pull request may close these issues.

4 participants