Skip to content

Commit 2551bb1

Browse files
committed
replace componentWillReceiveProps with componentDidUpdate
1 parent ee4ea53 commit 2551bb1

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

specs/__snapshots__/braintree.spec.jsx.snap

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,27 +144,21 @@ exports[`Braintree hosted fields renders and matches snapshot 1`] = `
144144
>
145145
<div
146146
className="braintree-hosted-field"
147-
id="braintree-field-wrapper-1"
148147
/>
149148
<div
150149
className="braintree-hosted-field"
151-
id="braintree-field-wrapper-2"
152150
/>
153151
<div
154152
className="braintree-hosted-field"
155-
id="braintree-field-wrapper-3"
156153
/>
157154
<div
158155
className="braintree-hosted-field"
159-
id="braintree-field-wrapper-4"
160156
/>
161157
<div
162158
className="braintree-hosted-field"
163-
id="braintree-field-wrapper-5"
164159
/>
165160
<div
166161
className="braintree-hosted-field"
167-
id="braintree-field-wrapper-6"
168162
/>
169163
</div>
170164
`;

src/braintree.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ export default class Braintree extends React.Component {
4141
this.api.teardown();
4242
}
4343

44-
componentWillReceiveProps(nextProps) {
45-
this.api.setAuthorization(nextProps.authorization, this.props.onAuthorizationSuccess);
44+
componentDidUpdate() {
45+
this.api.setAuthorization(this.props.authorization, this.props.onAuthorizationSuccess);
4646
}
4747

4848
tokenize(options) {

0 commit comments

Comments
 (0)