Skip to content

Commit

Permalink
[patch] use forwardRef instead of ref (#97)
Browse files Browse the repository at this point in the history
- this stops a warning being produced when testing which reads:
> Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?
 - Fixes #67
  • Loading branch information
TimLehner authored Mar 28, 2022
1 parent 5ba7fe7 commit 0833986
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hoc/trackWindowScroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const trackWindowScroll = BaseComponent => {

return (
<BaseComponent
ref={this.baseComponentRef}
forwardRef={this.baseComponentRef}
scrollPosition={scrollPosition}
{...props}
/>
Expand Down

0 comments on commit 0833986

Please sign in to comment.