Skip to content

Commit

Permalink
Add ref forwarding(#3)
Browse files Browse the repository at this point in the history
* fix bug

update version of react & react-dom to 16.3. Because React.forwardRef is only support on 16.3+

* Style
  • Loading branch information
MrToy authored and Minishlink committed Feb 7, 2019
1 parent cab1750 commit 2acc331
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ class Animation extends PureComponent {
}
}

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

0 comments on commit 2acc331

Please sign in to comment.