Skip to content

Instantly share code, notes, and snippets.

@techomoro

techomoro/App.js Secret

Created October 4, 2020 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techomoro/07a8ad970437fc8bb937a3188d24730e to your computer and use it in GitHub Desktop.
Save techomoro/07a8ad970437fc8bb937a3188d24730e to your computer and use it in GitHub Desktop.
componentDidMount() {
return fetch(`https://techomoro.com/wp-json/wp/v2/posts/`)
.then((response) => response.json())
.then((responseJson) => {
this.setState({
posts: responseJson,
})
})
.catch((error) => {
console.error(error);
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment