I feel like this call should be moved above the previous block of code. Otherwise you may end up with some old states in your component if the app author has just removed the attribute.