React Native - Redux : What is the way to reset setWaterSourceList value?

Viewed 21

What is the way to reset the value of setWaterSourceList ? I tried to do it like this:

dispatch(setWaterSourceList({}));

But it didn't work and gave a message:

undefined is not an object (evaluating 'nekudotDigumAvailable[0].Water_Source_Code')

the useSelector "nekudotDigumAvailable"

const nekudotDigumAvailable = useSelector(
    (state) => state.userReducer.waterSourceList
  );

the "setWaterSourceList" function from redux actions

export function setWaterSourceList(data) {
  return { type: SET_WATER_SOURCE_LIST, payload: data };
}
0 Answers
Related