Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
shouldUpdate prevents every update #2118
I'm trying to use the new shouldUpdate method. Unfortunately, it isn't working as I expected. Here is an example without the shouldUpdate:
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:
But that prevents the child from initializing. Am I missing something or is this a bug?
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.