const commentsFetcher = (url: string): Promise<fetchCommentsReturnType> => axios(url).then((res) => res.data); const { data: comments, error:commentsError } = useSWR( `https://example.com/api/v1/post/${props.query.id}/comments`, commentsFetcher ); useSWR()を使ってデータの取得方法がわからない方は「【Next.js】axiosを使ってSWRで取得する」を参照してください。 同じような方法でPOSTすることはできますが、その方法はオススメできません。 SWR公式ページにも「データ取得のための React Hooks ライブラリ」と書かれていま