Skip to content

Instantly share code, notes, and snippets.

View TimoStaudinger's full-sized avatar
🕹️
Computers. What a great idea.

Timo M. Staudinger TimoStaudinger

🕹️
Computers. What a great idea.
View GitHub Profile
@bvaughn
bvaughn / updating-external-data-when-props-changes-using-promises.js
Last active July 20, 2023 16:00
Example for loading new external data in response to updated props
// 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 {
_currentId = null;
state = {
externalData: null
};