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