Skip to content

Instantly share code, notes, and snippets.

@nabanita-sarkar
Last active February 2, 2022 16:53
Show Gist options
  • Save nabanita-sarkar/222fd5b3b0495be7311108143e91409b to your computer and use it in GitHub Desktop.
Save nabanita-sarkar/222fd5b3b0495be7311108143e91409b to your computer and use it in GitHub Desktop.
const { id } = useParams(); // from react-router
const { isLoading, isError, data } = useQuery(
["todo/detail", id],
() => {
return axios.get(`http://localhost:4000/todo/detail/:${id}`);
},
{
enabled: !!id,
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment