在尝试将一个动作分派到另一个动作时得到此错误。知道我在做什么错吗?
商店
export const setLocation = (coords, maxDistance) => {
return (dispatch) => {
return dispatch(setFilteredFacilities(coords, maxDistance))
.then(() => dispatch({
type: SET_LOCATION,
payload: {
latitude: coords.latitude,
longitude: coords.longitude
}
}));
};
};
动作
<Provider store={store}>
<App />
</Provider>
index.js
Unresolved reference: adapter
Unresolved reference: currentItem
Unresolved reference: addOnPageChangeListener
答案 0 :(得分:0)
您正在分派一个函数以及.then中的结果。您无法分派该功能。
export const setLocation = (coords, maxDistance) =>
{
return (dispatch) =>
{
setFilteredFacilities(coords, maxDistance)
.then(() =>
dispatch({ type: SET_LOCATION,
payload: { latitude: coords.latitude, longitude: coords.longitude }
})
);
}
};