()
| 1237 | } |
| 1238 | |
| 1239 | function Component() { |
| 1240 | const mutation = useMutation(() => ({ |
| 1241 | mutationFn: async (_text: string) => { |
| 1242 | count++ |
| 1243 | await sleep(10) |
| 1244 | return count |
| 1245 | }, |
| 1246 | mutationKey: mutationKey, |
| 1247 | gcTime: 0, |
| 1248 | onSuccess, |
| 1249 | onSettled, |
| 1250 | })) |
| 1251 | |
| 1252 | return ( |
| 1253 | <div> |
| 1254 | <button |
| 1255 | onClick={() => |
| 1256 | mutation.mutate('todo', { |
| 1257 | onSuccess: onSuccessMutate, |
| 1258 | onSettled: onSettledMutate, |
| 1259 | }) |
| 1260 | } |
| 1261 | > |
| 1262 | mutate |
| 1263 | </button> |
| 1264 | <div> |
| 1265 | data: {mutation.data ?? 'null'}, status: {mutation.status}, |
| 1266 | isPaused: {String(mutation.isPaused)} |
| 1267 | </div> |
| 1268 | </div> |
| 1269 | ) |
| 1270 | } |
| 1271 | |
| 1272 | const rendered = renderWithClient(queryClient, () => <Page />) |
| 1273 |
nothing calls this directly
no test coverage detected