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

injectTapEventPlugin() Called Twice in My Application #162

Closed
yoonwaiyan opened this issue Nov 23, 2016 · 3 comments
Closed

injectTapEventPlugin() Called Twice in My Application #162

yoonwaiyan opened this issue Nov 23, 2016 · 3 comments

Comments

@yoonwaiyan
Copy link

yoonwaiyan commented Nov 23, 2016

It is recommended to call injectTapEventPlugin() just before you call \
ReactDOM.render(). If you are using an external library which calls injectTapEventPlugin() \
itself, please contact the maintainer as it shouldn\'t be called in library code and \
should be injected by the application.

I understand that we can use admin-on-rest on any application not just as a standalone app, but it seems like the injectTapEventPlugin() is causing my Meteor pages not loading with this error because my Meteor application is using MaterialUI as well. I have tried patching both Admin.js and Layout.js to remove the injectTapEventPlugin() call in Layout, but this doesn't work either.

I suspect it's because it's already been called when the export statements are being called, because I'm still importing components from admin-on-rest/lib/mui which exports Layout as well. Opening this issue to see whether it's possible to have any workaround on this package first as we have tried different workarounds on our Meteor app itself but nothing seems to work, and the plugin error itself mentioned to contact package maintainer if this issue arises.

@ArnaudD
Copy link
Contributor

ArnaudD commented Nov 23, 2016

I have the same problem. My workaround was to duplicate admin-on-rest/src/mui in my sources and comment one line :

export * from 'admin-on-rest/lib/mui/button';
export * from 'admin-on-rest/lib/mui/detail';
export * from 'admin-on-rest/lib/mui/field';
export * from 'admin-on-rest/lib/mui/input';
// export * from 'admin-on-rest/lib/mui/layout';
export * from 'admin-on-rest/lib/mui/list';
export Delete from 'admin-on-rest/lib/mui/delete/Delete';

Edit: I'm not using admin-on-rest Layout

@fzaninotto
Copy link
Member

I suppose you're using React v15.4.0. It recently introduced a regression, and we can't upgrade yet (see #155 for an explanation). So I suggest you use react v15.3.2 instead.

@yoonwaiyan
Copy link
Author

Apparently tried both solutions but it seems way too complex to make it work in the Meteor application, but removing the function call entirely from the application and let the Layout do the same job for our local MaterialUI seems to work now.

Closing this for now, hopefully the newer updates in the near future will solve the problem.

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