JedWatson / react-hammerjs

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

Warning: Hammer: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. #84

Open petergab opened 6 years ago

petergab commented 6 years ago

I'm using:

"react": "15.0.1",
"react-dom": "15.0.1",
"react-hammerjs": "1.0.1",

Everything works like a charm, but I get the following error in console:

Warning: Hammer: `ref` is not a prop. Trying to access it will result in `undefined` 
being returned. If you need to access the same value within the child component, 
you should pass it as a different prop.

I think that React deprecated string refs and now only supports callback refs. https://facebook.github.io/react/docs/refs-and-the-dom.html#legacy-api-string-refs

Probably each instance of a string ref has to be updated to use a callback ref instead.

tobiaswaltl commented 6 years ago

As far as I can see the warning is thrown here where it is tried to access the ref prop directly.

Btw: If this was working, the ref callback would be executed twice!

fungjj92 commented 6 years ago

Bump, seeing this exact issue.