Previously we could do something like this:
export default connect(
(state) => {
const { data } = state.Something;
...
return {
data
};
},
(dispatch) =>
bindActionCreators(
{
getAdmins: (id) =>
getAdminsList(id),
},
dispatch
)
)(ComponentName);
With the useDispatch() Hook, how to achieve the same thing of renaming getAdminsList(id) as getAdmins(id)? The normal way is:
const dispatch = useDispatch();
Then use it as dispatch(getAdminsList(id));
How do I rename it to getAdmins(id)? Thanks.