()
| 1255 | } |
| 1256 | |
| 1257 | function Component() { |
| 1258 | const mutation = useMutation(() => ({ |
| 1259 | mutationFn: async (_text: string) => { |
| 1260 | count++ |
| 1261 | await sleep(10) |
| 1262 | return count |
| 1263 | }, |
| 1264 | mutationKey: mutationKey, |
| 1265 | gcTime: 0, |
| 1266 | onSuccess, |
| 1267 | onSettled, |
| 1268 | })) |
| 1269 | |
| 1270 | return ( |
| 1271 | <div> |
| 1272 | <button |
| 1273 | onClick={() => |
| 1274 | mutation.mutate('todo', { |
| 1275 | onSuccess: onSuccessMutate, |
| 1276 | onSettled: onSettledMutate, |
| 1277 | }) |
| 1278 | } |
| 1279 | > |
| 1280 | mutate |
| 1281 | </button> |
| 1282 | <div> |
| 1283 | data: {mutation.data ?? 'null'}, status: {mutation.status}, |
| 1284 | isPaused: {String(mutation.isPaused)} |
| 1285 | </div> |
| 1286 | </div> |
| 1287 | ) |
| 1288 | } |
| 1289 | |
| 1290 | const rendered = renderWithClient(queryClient, () => <Page />) |
| 1291 |
nothing calls this directly
no test coverage detected