Here is a sample JSON data:
{
"Id": 1,
"Title": "Information on Jane Smith",
"Comments": "Additional details here",
"UpdatedBy": "Jane Smith",
"UpdateDate": "May 25 2022 3:45PM"
}
I am looking to convert this JSON into MUI TextFields, with the label names as TextField labels and their corresponding values as TextField values. The ability to edit the values is also required.
Below is an example of how I'm handling my array of data:
const [specificDetails, setSpecificDetails] = useState("");
const fetchDetailsData = async (record_id, detail_id) => {
setSpecificDetails(
await fetch(`/api/years/YR2023/records/${params.id}/details/questions`).then((response) =>
response.json()
)
);
};
These are the instances of Text Fields being utilized in this scenario:
<TextField
value={}
label={}
/>