Improved logic of React animation mixin