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

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.

Open petergab opened this issue 8 years ago • 2 comments

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.

petergab avatar Nov 30 '17 09:11 petergab

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!

tobiaswaltl avatar Apr 13 '18 16:04 tobiaswaltl

Bump, seeing this exact issue.

fungjj92 avatar Aug 22 '18 15:08 fungjj92