In a Table Grid, The data populated on Grid is JSON which I'm receiving it from another component. It also has input fields like text box and date which can be changed. Here in this case, when a date value is changed it gets updated in console but on UI. Please refer to code below:
const [startDate, setStartDate] = useState();
{colConfig[cIndex].data_type === "date" &&
!colConfig[cIndex].cell_click_callback && (
<div>
<DatePickerNew
setRequesterDate={(e) =>
dateCallback({dateVal: e, id: rowData[0].id})}
startDate={colData} <-- Here colData is used which comes from JSON
setStartDate={setStartDate}
/>
</div>
)}
As you can see from above code, I have used 'colData', since, I want to make changes on that value, I know we need to make use of 'startDate', but want to change the JSON data and process it further. Here I'm mimicking the API received as JSON. What code changes can be done to set the 'colData' and reflect it in UI.
As seen from above image, record with name 'Shawns', the date has been changed which is seen in console below, but, not on UI. Any suggestions or code changes highly appreciated
Please refer to codesandbox link as well -> https://codesandbox.io/s/elated-varahamihira-xpjtdb?file=/src/Grid.js:2386-3065
