Unexpected Application Error!
Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object
import { useQuery } from "@tanstack/react-query";
const AllUsers = () => {
const {data: users = [], refetch} = useQuery(['users'], async() => {
const res = await fetch('http://localhost:5000/users')
return res.json();
})
return (
<div>
{users.length}
</div>
);
};
export default AllUsers;
2
Answers
try to send parameter in an object format. Example:
// I have this problem; The solution to this problem;