Last active
December 23, 2021 08:02
-
-
Save RoySegall/0c31f379f1b629e8d4a94a8a67816073 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
const Pokemon = () => { | |
const {id} = useParams(); | |
const pokemon = useMemo(async () => { | |
try { | |
cosnt results = await getPokemon(id); | |
return results.data; // or watever... | |
} catch (e) { | |
console.log('There was an error', e); | |
return null; | |
} | |
}, [id]); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment