My Reducer
export default function saveContactsReducer(state = {}, { type, contacts }) {
switch (type) {
case types.SAVE_CONTACTS:
return {
...state,
contactsDetails: contacts,
currentUserName: contacts.personName
}
default:
return state;
}
}
My Action
import * as types from './actionTypes';
function saveContacts(contacts) {
return { type: types.SAVE_CONTACTS, contacts: contacts }
}
export default saveContacts;
My Action dispatch
dispatch(contactsAction(contactsDetails));
When I am using the useSelector hook from the react-redux
My state is like this
state.saveContactsReducer: {contacts}}
Instead I want state.contacts and don't want reducer name