I have beolow code
const [data,setData] = useState(obj)
Now I am passing this data to some component
<comp data={data} />
Now When I do below
setData(newOBj);
then comp does not render again
but when I do something like changing any property it works
setData(prev=> ({
...prev,
pOPageIndex: null,
cCPageIndex: null
}));
How do we replace complete object and make the component render again
Thanks