0
如何在对象传递设定数组的从反应部件用于后请求:这应该是我的请求对象的结构:reactjs动作创作者传递数组
{
"test": [
"abc"
],
"test2": [
"def"
],
"test3": [
"sds"
],
"name": "sam"
}
得到错误当我做:
阵营组件:
this.props.actioncreatorCall(
someurl,
["abc"],
["def"],
["sasd"],
"sam"
);
行动的创建者:
export function apiCAll(someurl,{test, test2, test3, name}) {
return function dispatchUser(dispatch) {
axios.post((url),{test,
test2,
test3,
name},{ },
).then((response) => {
dispatch({
type: DATA_POST,
payload: response.data,
});
browserHistory.push('/NEXTPAGE');
})
.catch(() => {
//SOME ERROR
});
}; }
非常感谢大通。真的很感激它。 – splendidDev