何が問題でしょうか?アクションはプレーンオブジェクトでなければなりません。カスタムミドルウェアを使用する
Uncaught Error: Actions must be plain objects. Use custom middleware for async actions.
設定ストア:
export default configureStore =() => {
let store = compose(applyMiddleware(ReduxThunk))(createStore)(reducers);
return store;
}
アクションすべてのアクションは、オブジェクトを返す必要がありReduxの中であなたはそれを間違った方法を使用している
export const menulist = async ({ navigation }) => {
return async dispatch => {
try {
dispatch({ type: types.MENULIST_REQUEST_START })
let response = await menuListByCategories();
dispatch({ type: types.MENULIST_SUCCESS })
} catch (error) {
dispatch({ type: types.MENULIST_FAILED })
}
}
}
エラーが明確に記載されています:アクション作成者は、 'type'プロパティとオプションのペイロードを持つプレーンオブジェクトを返す必要があります。ここでは、 'dispatch'引数をとる関数を返しています。 – lukaleli