I have a functional React component, like that:
const RefreshButton = () => (
<IconButton >
<RefreshIcon />
</IconButton>
)
What I need is to assign dynamically class attribute to child RefreshIcon node upon clicking IconButton (onClick), run CSS-animation bound to that class and remove that class as animation goes off (onAnimationEnd).
My problem is that I have absolutely no clue as of how do I refer child Component from within onClick and onAnimationEnd callbacks.
I have come across that topic, but it's all about class-based components and I'm not really sure how to adopt proposed solution, so I'd appreciate a lot if you point me to the right direction.