Skip to content

Commit 0ae1568

Browse files
authored
Update README.md (#44)
Updated TS example to reflect the new object parameters for RQ V5
1 parent 5e5dedb commit 0ae1568

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,13 @@ import {
107107

108108
function App() {
109109
// You can still use the auto-generated query key
110-
const { data } = useQuery([usePetServiceFindPetsByStatusKey], () => {
111-
// Do something here
112-
113-
return PetService.findPetsByStatus(['available']);
114-
});
110+
const { data } = useQuery({
111+
queryKey: [usePetServiceFindPetsByStatusKey],
112+
queryFn: () => {
113+
// Do something here
114+
return PetService.findPetsByStatus(['available']);
115+
}
116+
});
115117

116118
return (
117119
<div className="App">

0 commit comments

Comments
 (0)