Skip to content

Instantly share code, notes, and snippets.

// This is an example of how to fetch external data in response to updated props,
// If you are using an async mechanism that does not support cancellation (e.g. a Promise).
class ExampleComponent extends React.Component {
_hasUnmounted = false;
state = {
externalData: null
};