이거만 찝어서
type = PickType = Pick<@@Props, "ㅁㅁ">
ㅁㅁ이랑 ㅎㅎ만 제외하고
type = OmitType = Omit<@@Props, "ㅁㅁ" | "ㅎㅎ">
yarn add @tanstack/react-query @tanstack/react-query-devtools
// queryClient 는 리덕스와 비교 시 store 에 해당하는 개념이라 할 수 있습니다.
// main.jsx
const queryClient = new QueryClient();
ReactDOM.createRoot(document.getElementById("root")).render(
<QueryClientProvider client={queryClient}>
<ReactQueryDevtools initialIsOpen={false} />
<App />
</QueryClientProvider>
);
오랜만에 api에서 fetch 썼는데 이상하게 src 폴더 내에서는 안 되는데 앱에서는 된다...
api.ts
const fetchData = async () => {
try {
const response = await fetch("https://restcountries.com/v3.1/all");
const data = await response.json();
console.log(data);
return data;
} catch (error) {
console.log(error);
}
};
fetchData().then((res) => console.log(res));
해당 폴더 말고 동작되는 곳에서 하니까 됨... 변환 과정이 안 되니까,,,,, 작동 되는 곳에서 임포트 해서 썼더니 된다....