| 1790 | const states: Array<UseQueryResult<number>> = [] |
| 1791 | |
| 1792 | function FirstComponent() { |
| 1793 | const state = useQuery({ |
| 1794 | queryKey: key, |
| 1795 | queryFn: () => sleep(10).then(() => 1), |
| 1796 | notifyOnChangeProps: 'all', |
| 1797 | }) |
| 1798 | const refetch = state.refetch |
| 1799 | |
| 1800 | states.push(state) |
| 1801 | |
| 1802 | return ( |
| 1803 | <div> |
| 1804 | <button onClick={() => refetch()}>refetch</button> |
| 1805 | data: {state.data} |
| 1806 | </div> |
| 1807 | ) |
| 1808 | } |
| 1809 | |
| 1810 | function SecondComponent() { |
| 1811 | useQuery({ queryKey: key, queryFn: () => 2, notifyOnChangeProps: 'all' }) |