Uncaught TypeError: Cannot read property 'login' of undefined...........
import Login from '../components/Login.jsx';
import { useDeps, composeWithTracker, composeAll } from 'mantra-core';
export const composer = ({context, clearErrors}, onData) => {
const { LocalState } = context();
const error = LocalState.get('LOGIN_ERROR');
onData(null, { error });
// clearErrors when unmounting the component
return clearErrors;
};
export const depsMapper = (context, actions) => ({
loginUser: actions.users.login,
clearErrors: actions.users.clearErrors,
context: () => context
});
export default composeAll(composeWithTracker(composer), useDeps(depsMapper))(Login);
Because actions.users
is undefined.
I think actions
doesn't have a property named users
.
Please check your actions .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.