2017-10-16 98 views
-1

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); 
+4

C#,PHP,Android和JS ...?你是否爲這個問題選擇了隨機標籤?尋求調試幫助的問題(「爲什麼不是這個代碼工作?」)必須包括所需的行爲,特定的問題或錯誤以及在問題本身**中重現**的最短代碼。沒有**明確問題陳述**的問題對其他讀者沒有用處。請參閱:[如何創建最小,完整和可驗證示例](https://stackoverflow.com/help/mcve)。 –

+0

無論'行動'是沒有屬性稱爲'用戶'(這行'actions.users.login') - 其餘的只有你和你的天知道 –

回答

1

財產 '登錄' 因爲actions.users是不確定的。

我認爲actions沒有名爲users的屬性。

請檢查您的動作

相關問題