Skip to content

Instantly share code, notes, and snippets.

@AllanGraves
Created January 17, 2021 11:54
Show Gist options
  • Save AllanGraves/b3f5fda604670760ebae18ffda7e514e to your computer and use it in GitHub Desktop.
Save AllanGraves/b3f5fda604670760ebae18ffda7e514e to your computer and use it in GitHub Desktop.
adding a cleanup (componentWillUnmount) log message.
useEffect(() => {
console.log(
`Location:IN MOUNT:
LocationID: ${locationID} + StoryID: ${storyID} + curLocation: ${curLocation}`,
);
return () => {
console.log('Location: CleaningUP');
};
}, []);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment