๐ย Reference
import { ReactQueryDevtools } from "react-query/devtools";
import './App.css';
import { Routes, Route, Link } from 'react-router-dom';
import { QueryClient, QueryClientProvider } from 'react-query';
import { ReactQueryDevtools } from 'react-query/devtools';
import { HomePage } from './components/Home.page';
import { RQSuperHeroesPage } from './components/RQSuperHeroes.page';
import { SuperHeroesPage } from './components/SuperHeroes.page';
const queryClient = new QueryClient();
function App() {
return (
<QueryClientProvider client={queryClient}>
<nav>
<ul>
<li>
<Link to='/'>Home</Link>
</li>
<li>
<Link to='/super-heroes'>Traditional Super Heroes</Link>
</li>
<li>
<Link to='/rq-super-heroes'>RQ Super Heroes</Link>
</li>
</ul>
</nav>
<Routes>
<Route path='/' element={<HomePage />} />
<Route path='/super-heroes' element={<SuperHeroesPage />} />
<Route path='/rq-super-heroes' element={<RQSuperHeroesPage />} />
</Routes>
<ReactQueryDevtools initialIsOpen={false} position='bottom-right' />
</QueryClientProvider>
);
}
export default App;
fresh
fetching
stale
inactive
์ ๊ฐ์ Data Fetching State๋ฅผ ํ์ธํ ์ ์๋ค.
Observer
๋ ํด๋น API call๋ฅผ ์์ฒญํ๋ observer
์ ์๋ฅผ ๋ํ๋ด๋ฉฐ, ์ด ๊ฒฝ์ฐ์ RQ super heroes page
๋ด์ useQuery
call์ ๋ํ๋ธ๋ค.Last Updated
์์ ๋ง์ง๋ง์ผ๋ก query
๋ฅผ ๋ถ๋ฌ์จ ์๊ฐ์ ํ์ธํ ์๋ ์๋ค.Actions
๋ฒํผ์ query
์ ๊ด๋ จ๋ action
์ ํด๋ณผ ์๋ ์๋ค.