I'm trying to change the status in the users array. I'm trying to update the status to 'Yes'. How can i be able to access its data without mutating the state?
Pls see this codesandbox link
const dispatch = useDispatch();
const isLoading = useSelector(state => state.user.isLoading);
const users = useSelector(state => state.user.users);
const onApprove = user => {
dispatch(approveUser(user));
};
useEffect(() => {
dispatch(getUsers());
}, [dispatch]);