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

bug of version 0.2.2 #59

Closed
xiaosong opened this issue Feb 2, 2016 · 4 comments
Closed

bug of version 0.2.2 #59

xiaosong opened this issue Feb 2, 2016 · 4 comments

Comments

@xiaosong
Copy link

xiaosong commented Feb 2, 2016

When I upgrade to 0.2.2, I got an error below:

Uncaught Invariant Violation: EventPluginRegistry: Cannot inject two different event plugins using the same name, `TapEventPlugin`.

I have two components require react-tap-event-plugin, each component have this line: require('react-tap-event-plugin')()

In version 0.2.1, it works fine but when I upgrade to 0.2.2, it did not work. Once I comment one of require('react-tap-event-plugin')(), it woks fine again.

@madjam002
Copy link

@xiaosong You're supposed to inject the tap event plugin once at the start of your application, not in each component.

If you're writing a library which provides components which require tap event plugin, you need to tell the consumer of your library to inject tap event plugin themselves.

Is that okay?

@xiaosong
Copy link
Author

xiaosong commented Feb 3, 2016

@madjam002 Why not your plugin determine whether tap event plugin is injected before inject?

@madjam002
Copy link

@xiaosong Take a look at mui/material-ui#3079 (comment)

This is an ongoing discussion and will likely be fixed soon, I'll keep you posted. 👍

@madjam002
Copy link

I'm going to close this in favour of #47, it's not as simple as just checking to see if the plugin has already been injected unfortunately.

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

2 participants