-
-
Save linux08/e910237b4e0c9b7411bac46a8d1ae980 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
componentDidMount() { | |
const config = { | |
method: 'GET', | |
headers: { | |
Accept: 'application/json' | |
}, | |
}; | |
fetch('http://10.0.2.2:5000/images', config) | |
.then((resp) => resp.json()) | |
.then((res) => { | |
this.setState({ | |
images: res, | |
fetchLoading: false | |
}) | |
}) | |
.catch((err) => { | |
console.log('err', err.message) | |
this.setState({ | |
fetchLoading: false, | |
error: err.message | |
}); | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment