JedWatson / react-hammerjs

ReactJS / HammerJS integration. Support touch events in your React app.
MIT License
937 stars 129 forks source link

Hammer breaks ref in children #93

Open ibc opened 6 years ago

ibc commented 6 years ago

The ref callback is not called in children elements inside a <Hammer> tag. This did not happen 2 years ago (using older versions of React and react-hammerjs).

It seems that this is broken when using React 16.

ArtemBernatskyy commented 6 years ago

+1

brianarpie commented 6 years ago

I also ran into this issue. My application relies on the inner refs.

onelson commented 6 years ago

Ran into this today. Found that the first ref in my render() call didn't fire correctly, but others did.

By trial and error, I eventually found that I could wrap all the children of the <Hammer/> component with an extra div to "swallow" whatever is going wrong, and then all my ref callbacks in the deeper components worked.

Not great, but it's a workaround.

alekseykarpenko commented 4 years ago

Duplicate of #83