2. 목록보기
1. 상품 목록
2. 컴포넌트의 점진적 분리
3. api fetch hook을 간단히 구현하고 화면에 집중
4. nullish 병합 연산자(??)를 사용한 이유
const apiBaseUrl = 'https://shop-demo-api-01.fly.dev';
export default function useFetchProducts() {
type Data = {
products: ProductSummary[];
};
const { data } = useFetch<Data>(`${apiBaseUrl}/products`);
return {
products: data?.products ?? [],
};
}5. intl API 링크
6. Axios vs Fetch
문법
JSON 데이터 처리
자동 문자열 변환(stringify)
Last updated