()
| 6183 | } |
| 6184 | |
| 6185 | function Test() { |
| 6186 | const [id, setId] = React.useState(1) |
| 6187 | |
| 6188 | const { data } = useQuery({ |
| 6189 | select: selector, |
| 6190 | queryKey: [key, 'user', id], |
| 6191 | queryFn: () => fetchNumber(id), |
| 6192 | }) |
| 6193 | |
| 6194 | React.useEffect(() => { |
| 6195 | spy(data) |
| 6196 | }, [data]) |
| 6197 | |
| 6198 | return ( |
| 6199 | <div> |
| 6200 | <button name="1" onClick={() => setId(1)}> |
| 6201 | 1 |
| 6202 | </button> |
| 6203 | <button name="2" onClick={() => setId(2)}> |
| 6204 | 2 |
| 6205 | </button> |
| 6206 | <span>Rendered Id: {data?.id}</span> |
| 6207 | </div> |
| 6208 | ) |
| 6209 | } |
| 6210 | |
| 6211 | function selector(data: any) { |
| 6212 | return data.numbers.current |
nothing calls this directly
no test coverage detected