I have this little visibility changer, and it works flawlessly for changing the attribute of the visibility variable, but my problem is, that it deletes every other variable from "productsState". It shouldn't be keeping the other variables?
const listing = () => {
const visibility= !productsState.visibility;
setProdState({visibility : visibility})
}