| 1813 | const states: Array<UseQueryResult<number>> = [] |
| 1814 | |
| 1815 | function FirstComponent() { |
| 1816 | const state = useQuery({ |
| 1817 | queryKey: key, |
| 1818 | queryFn: () => sleep(10).then(() => 1), |
| 1819 | notifyOnChangeProps: 'all', |
| 1820 | }) |
| 1821 | const refetch = state.refetch |
| 1822 | |
| 1823 | states.push(state) |
| 1824 | |
| 1825 | return ( |
| 1826 | <div> |
| 1827 | <button onClick={() => refetch()}>refetch</button> |
| 1828 | data: {state.data} |
| 1829 | </div> |
| 1830 | ) |
| 1831 | } |
| 1832 | |
| 1833 | function SecondComponent() { |
| 1834 | useQuery({ queryKey: key, queryFn: () => 2, notifyOnChangeProps: 'all' }) |