React mixin which detects when component resizes and sets the new width as a state variable