Fix react invariant violation error