Skip to content

Instantly share code, notes, and snippets.

@johncorderox
Last active April 30, 2021 16:42
Show Gist options
  • Save johncorderox/64c0fe6de0a73e7506dae934a354708c to your computer and use it in GitHub Desktop.
Save johncorderox/64c0fe6de0a73e7506dae934a354708c to your computer and use it in GitHub Desktop.
React Delete + Axios
// After an API call to delete, refresh the state with Filter.
var NewThings = this.state.things.filter((x) => { return x.id != id;});
@johncorderox
Copy link
Author

This can be ran with the Axios library after axios.delete is called to remove the item(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment