Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verificar se CreditCard se está montado #13

Open
muriloneo opened this issue Sep 14, 2019 · 0 comments
Open

Verificar se CreditCard se está montado #13

muriloneo opened this issue Sep 14, 2019 · 0 comments

Comments

@muriloneo
Copy link

Ao tentar gerar um pagamento ele estoura um erro. tem que verificar se o componente está montado.

componentDidMount() { 
  this._ismounted = true;
}

componentWillUnmount() {
   this._ismounted = false;
}

Provavelmente está acontecendo porque estou tratando a apresentação do componente DirectPayment, ocultando no "re-render" se o status estiver loading == true.

<CreditCard {...this.props} amount={amount} onSubmit={onSubmit} onError={onError} cards={paymentMethods.find(item => item.name == 'CREDIT_CARD').options} />

Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.
in CreditCard (created by DirectPayment/Forms/Payment)
in div (created by Context.Consumer)
in StyledComponent (created by Col)
in Col (created by DirectPayment/Forms/Payment)
in div (created by Context.Consumer)
in StyledComponent (created by Row)
in Row (created by DirectPayment/Forms/Payment)
in div (created by DirectPayment/Forms/Payment)
in DirectPayment/Forms/Payment (created by DirectPayment)
in div (created by Context.Consumer)
in StyledComponent (created by styled.div)
in styled.div (created by DirectPayment)
in div (created by Context.Consumer)
in StyledComponent (created by styled.div)
in styled.div (created by DirectPayment)
in LoadLibrary (created by DirectPayment)
in DirectPayment (created by Checkout)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant