Browse Source
Merge pull request #745 from nateq314/patch-1
Fix cDU to correctly make async request
main
Brian Vaughn
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
examples/update-on-async-rendering/updating-external-data-when-props-change-after.js
|
@ -25,7 +25,7 @@ class ExampleComponent extends React.Component { |
|
|
|
|
|
|
|
|
// highlight-range{1-5}
|
|
|
// highlight-range{1-5}
|
|
|
componentDidUpdate(prevProps, prevState) { |
|
|
componentDidUpdate(prevProps, prevState) { |
|
|
if (prevState.externalData === null) { |
|
|
if (this.state.externalData === null) { |
|
|
this._loadAsyncData(this.props.id); |
|
|
this._loadAsyncData(this.props.id); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|