【发布时间】:2018-01-12 09:20:07
【问题描述】:
我正在使用带有 react 的 redux。这使得 dispatch 可以作为组件中的 props 使用。所以当我console.log(this.props) 我在调度键下的日志中看到以下对象。
[[Scopes]]: Scopes[5]
0:Closure
1:Closure
2:Closure (createThunkMiddleware)
3:Closure
4:Global
有人能解释一下这是什么吗?
【问题讨论】:
-
一个很奇怪的输出?
-
完整日志
dispatch: function (action) arguments: (...) caller: (...) length:1 name: "" prototype: Object __proto__:function () [[FunctionLocation]] : index.js?f248:9 [[Scopes]]: Scopes[5] errorText:undefined } -
我不明白这个问题 :-) 你没有 dispatch in props 吗?
-
是的,我有..就是这样。它工作正常..我只想知道这个日志的含义是什么。什么是 [[Scopes]] 及其闭包。
标签: javascript reactjs google-chrome redux react-redux