-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example for how to go
in function
#4
Comments
Seems to have been added to the readme already:
|
Hi @beepcode, sorry for not clear. I mean using in user鈥檚 own function like the handleGo in the above code. |
Ok, the simplest solution would be to pass the go() function as a parameter. This would look like so:
...
|
Thanks, @beepcode , that is what I thought. But If it is, maybe the author can export something like below to help avoid rerender? import { morphGo } from "react-morph";
handleGo = () => {
morphGo();
// something else
} |
You could use the lifecycle method "shouldComponentUpdate()" to prevent rerender. |
Thanks, I get it. |
What are you trying to achieve exactly? Which "business case" are you trying to find a solution to? From my perspective the sole purpose of "go()" is to start the morph, so rerender is expected. Or are you trying to trigger the morph from outside? |
Oh, you are right! I forget rerender is necessary in this case for the animation. My bad. |
An example for how to
go
in function will be great. Thanks for the cool package!The text was updated successfully, but these errors were encountered: