Answer. 서버에서 하면 좋은 작업과 클라이언트만 할 수 있는 작업을 분리
export const HelloPage = () => {
const someApi = await fetch("/api/dates").then((res) => await res.json());
return <TimeList dates={someApi} />;
};
("use client");
export const TimeList = ({ dates }: { dates: string[] }) => {
const clientFormatter = new Intl.DateTimeFormat();
return (
<>
{dates.map((date) => (
<time>{clientFormatter.format(date)}</time>
))}
</>
);
};