json
用于
new Response(JSON.stringify(someValue), {
headers: {
"Content-Type": "application/json; utf-8",
},
});
通常用于加载器
import { json } from "react-router-dom";
const loader = async () => {
const data = getSomeData();
return json(data);
};
另请参阅