You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You'll notice that when I press any button, the child updates. But if the value don't change, I don't want the child to update. So, I tried to define shouldUpdate as follows:
Note that I'm using parent.value in shouldUpdate instead, but I also need to assign this method only after mounting it seems. Which might be confusing indeed.
I found confusing that on shouldUpdate method, opts.* contains the old values and on update method, opts.* contains the new values. But since I can use the tag.* to reference the old values I believe it's ok for me.
But yes, shouldUpdate having to be assigned only after mount is confusing too.
Hi,
I'm trying to use the new shouldUpdate method. Unfortunately, it isn't working as I expected. Here is an example without the shouldUpdate:
https://jsfiddle.net/u0u7q2zr/2/
You'll notice that when I press any button, the child updates. But if the value don't change, I don't want the child to update. So, I tried to define shouldUpdate as follows:
https://jsfiddle.net/hn9mzxuh/1/
But that prevents the child from initializing. Am I missing something or is this a bug?
The text was updated successfully, but these errors were encountered: