Skip to content

Commit 0833986

Browse files
authored
[patch] use forwardRef instead of ref (#97)
- 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
1 parent 5ba7fe7 commit 0833986

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/hoc/trackWindowScroll.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const trackWindowScroll = BaseComponent => {
124124

125125
return (
126126
<BaseComponent
127-
ref={this.baseComponentRef}
127+
forwardRef={this.baseComponentRef}
128128
scrollPosition={scrollPosition}
129129
{...props}
130130
/>

0 commit comments

Comments
 (0)