react-tap-event-plugin icon indicating copy to clipboard operation
react-tap-event-plugin copied to clipboard

How to use when there are multiple components?

Open audetpascale opened this issue 9 years ago • 1 comments

Hi,

Context: we are using React and Kendo (do not blame me lol). Currently, we have the main application, everything is fine with the plugin. However, when I render a new component in the Kendo stuff, well, the plugin is "unavailable" (or seems to).

In other words, I can have two and more ReactDOM.render(...) in a page, the main app and the one created inside Kendo lib. Is it my issue? If yes, do you have suggestion?

Thanks for your response and plugin! Pascale Audet

audetpascale avatar Jun 21 '16 20:06 audetpascale

Yes, I have this issue too. I'm trying to do like this in every component:

try {
  // wrapping it in try-catch to prevent errors on duplicate injection
  injectTapEventPlugin();  
} catch (error) {  
}

But I'm not sure if it works correctly - I have just started. I would also recommend to replace an error throw on calling the injectTapEventPlugin() with a warning.

alexiusp avatar Jun 09 '17 08:06 alexiusp