I have List Component to show the list of data, in each row I have edit button, when user click on edit button, child component open and ready for update, the problem is when user update row list doesn't update
this is the handleAcceptButton
in List component
const [forceUpdate, setForceUpdate ] = React.useState(false);
const handleAcceptClose = async() => {
const temp = await childRef.current.checkWhatIs();
console.log('---befor--setForceUpdate-----',forceUpdate)
setForceUpdate(!forceUpdate)
console.log('---after--setForceUpdate-----',forceUpdate)
};
this is the useEffect
for get the List data
useEffect(() => {
async function getData(urlMe) {
await axios
.get(`${BaseURL}/helpSeekers/helpSeekersListAll`)
.then((response) => {
setData(response.data.result.data);
setlinkPages(response.data.result.links);
setForceUpdate(false); //// this is for reloading
});
}
if (loadingNextData) {
getData(urlMe);
}
}, [forceUpdate])
when user Update the the row and click on the handleAcceptButton
the useEffect doesn't rerender