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