Skip to content

Commit 2acc331

Browse files
MrToyMinishlink
authored andcommitted
Add ref forwarding(#3)
* fix bug update version of react & react-dom to 16.3. Because React.forwardRef is only support on 16.3+ * Style
1 parent cab1750 commit 2acc331

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,6 @@ class Animation extends PureComponent {
3737
}
3838
}
3939

40-
export default Animation;
40+
export default React.forwardRef((props, ref) => (
41+
<Animation {...props} ref={typeof ref == 'function' ? c => ref(c && c.anim) : ref} />
42+
));

0 commit comments

Comments
 (0)