React component variable not in state