Skip to content

Commit

Permalink
replace componentWillReceiveProps with componentDidUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanstitt committed Mar 16, 2020
1 parent ee4ea53 commit 2551bb1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
6 changes: 0 additions & 6 deletions specs/__snapshots__/braintree.spec.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -144,27 +144,21 @@ exports[`Braintree hosted fields renders and matches snapshot 1`] = `
>
<div
className="braintree-hosted-field"
id="braintree-field-wrapper-1"
/>
<div
className="braintree-hosted-field"
id="braintree-field-wrapper-2"
/>
<div
className="braintree-hosted-field"
id="braintree-field-wrapper-3"
/>
<div
className="braintree-hosted-field"
id="braintree-field-wrapper-4"
/>
<div
className="braintree-hosted-field"
id="braintree-field-wrapper-5"
/>
<div
className="braintree-hosted-field"
id="braintree-field-wrapper-6"
/>
</div>
`;
4 changes: 2 additions & 2 deletions src/braintree.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export default class Braintree extends React.Component {
this.api.teardown();
}

componentWillReceiveProps(nextProps) {
this.api.setAuthorization(nextProps.authorization, this.props.onAuthorizationSuccess);
componentDidUpdate() {
this.api.setAuthorization(this.props.authorization, this.props.onAuthorizationSuccess);
}

tokenize(options) {
Expand Down

0 comments on commit 2551bb1

Please sign in to comment.