friktor / react-material-icons

Simple component for anomated Material Icons in React.

Home Page:http://friktor.github.io/react-material-icons/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Morph function does not morph icon....

Mantic opened this issue · comments

I'm trying to do something similar as in the example in my own app, but for some reason I can't get icon morphing to work. I'm running React v15 and the latest react-material-icons. My object looks like this:

<MorphIcon shapes={{left: icons.hardware.keyboard_arrow_left, right: icons.hardware.keyboard_arrow_right}} options={{duration: 500}} ref={key} />

and when a button is pressed, I call:

this.refs[key].morph('left')

I've tried hard-coding the ref key to a simple name, but that doesn't work. I see that the icons morph initially into their first state, but once set, I cant' change them. Would this be a React caching issue?

Thanks,
-Mike