ㅡ ㅡ ㅡ ㅡ
- server component tags: ['~'] 설정하고
revalidateTag
를 trigger하면 데이터가 갱신되지만 데이터를 수정하면 전의 데이터로 돌아옴?
- not-found.tsx 파일이 dynamic route 에 적용되지 않음
ㅡ ㅡ ㅡ ㅡ
revalidateTag
를 trigger하면 데이터가 갱신되지만 데이터를 수정하면 전의 데이터로 돌아옴?// https://github.com/vercel/next.js/discussions/47583#discussioncomment-5449707 | |
"use client"; | |
import type { ChangeEvent } from "react"; | |
import { usePathname, useRouter, useSearchParams } from "next/navigation"; | |
const options = ["mew", "mewtwo", "pikachu"]; |
import React, { useEffect } from 'react';
import { useState } from 'react';
type checkType = {
valueList: string[];
initialCheckeds: string[];
onChange?: () => void;
};
https://github.com/sweetalert2/sweetalert2-react-content
npm install --save sweetalert2 sweetalert2-react-content
받아오는 데이터 key값 or 형식 변경하고 싶을 때 src/utils/parseData.ts
export const parseProductData = (productData: ProductData): Product => {
return {
id: String(productData.product_id),
price: String(productData.price),
name: productData.name,
thumbnail: productData.image_url,
useCheckBox에서 다른 컴포넌트로 set하는 부분 전송하고 받을 때 타입 지정
const [checkBox, setCheckBox] = useCheckBox(false);
import { useState, useEffect } from 'react'; | |
const useFetch = (defaultValue, callback) => { | |
const [response, setResponse] = useState(defaultValue); | |
const [error, setError] = useState(''); | |
const [loading, setLoading] = useState(false); | |
const fetchData = async () => { | |
setLoading(true); |