question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`ref` is not a prop. Trying to access it will result in `undefined` being returned.

See original GitHub issue

Warning: InfiniteScroll: `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. (https://fb.me/react-special-props)

It would be great to change the name of ‘ref’ prop to something other, because it is reserved in React for special props.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:12
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
hugonasciutticommented, Jul 1, 2019

Is this lib abandoned?

7reactions
danboveycommented, Nov 4, 2017

A code example would be nice. I don’t see the need for accessing the ref prop on any component. You should be passing function refs instead of strings, yeah? Then there’s no need to call on InfiniteScroller.props.ref.

<InfiniteScroll ref={c => this._scroll = c}>
    {items}
</InfiniteScroll>
Read more comments on GitHub >

github_iconTop Results From Across the Web

React: ref is not a prop - Stack Overflow
1 Answer 1 · I do not have ref or key defined in any of my react components. – shawn · Some the...
Read more >
Key is not a prop. Trying to access it will result in `undefined`
The warning " key is not a prop. Trying to access it will result in undefined being returned" is caused when we try...
Read more >
Warning: ref is not a prop #2181 - JedWatson/react-select
Trying to access it will result in undefined being returned. If you need to access the same value within the child component, you...
Read more >
Refs can't be props in React - Scrimba.com
"Warning: FancyButton: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the...
Read more >
Forwarding Refs - React
function FancyButton(props) { return ( <button className="FancyButton"> ... Other components using FancyButton usually will not need to obtain a ref to the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found