【发布时间】:2019-04-01 18:33:01
【问题描述】:
我正在通过 redux 向应用程序类发送请求响应。 我可以在道具中收到它 console.log(this.props.data);
但是我得到了这个嵌套数组,里面装满了对象
我试过了
console.log(this.props.data[0].PromiseValue);
这导致未定义
[Promise]
0: Promise
__proto__: Promise
[[PromiseStatus]]: "resolved"
[[PromiseValue]]: Object
config: {adapter: ƒ, transformRequest: {…}, transformResponse: {…}, timeout: 0, xsrfCookieName: "XSRF-TOKEN", …}
data: (10) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]
headers: {pragma: "no-cache", content-type: "application/json; charset=utf-8", cache-control: "public, max-age=14400", expires: "Mon, 01 Apr 2019 22:25:19 GMT"}
request: XMLHttpRequest {onreadystatechange: ƒ, readyState: 4, timeout: 0, withCredentials: false, upload: XMLHttpRequestUpload, …}
status: 200
statusText: ""
【问题讨论】:
标签: javascript reactjs redux axios