react-hammerjs icon indicating copy to clipboard operation
react-hammerjs copied to clipboard

Hammer breaks ref in children

Open ibc opened this issue 7 years ago • 4 comments

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.

ibc avatar Apr 15 '18 20:04 ibc

+1

ArtemBernatskyy avatar Jul 11 '18 09:07 ArtemBernatskyy

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

brianarpie avatar Aug 10 '18 16:08 brianarpie

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.

onelson avatar Sep 11 '18 01:09 onelson

Duplicate of #83

alekseykarpenko avatar Dec 29 '19 18:12 alekseykarpenko