错误:undefined不是对象(求值'this.props.menuOptions.map')
Error: undefined is not an object (evaluating 'this.props.menuOptions.map')
使用Angular, React和ReactNG,我得到这个错误:
Error: undefined is not an object (evaluating 'this.props.menuOptions.map')
代码如下:
http://jsbin.com/xuranipuza/1/edit?html、js、输出
似乎您缺少提供与您正在传递的propTypes
相关的react指令元素中的属性。因为它会监视这些属性值(反映作用域属性名),并相应地填充props。
:
<sidebar-button menu-options="menuOptions" button-image="buttonImage"
button-image-mini="buttonImageMini" menu-option-bottom="menuOptionBottom">
</sidebar-button>
本
医生说:
reactDirective服务将读取React组件的propTypes并观察带有这些名称的属性。如果你的react组件没有定义propTypes,你可以传入一个属性名数组来观察。默认情况下,将按值监视属性,但是您也可以通过提供watch-depth属性选择按引用或集合监视。可能的值为reference, collection和value(默认值)。
免责声明:我以前没有使用过ng-react
相关文章:
- $(this).prop('property') vs. this.property
- Twitter Bootstrap typeahead:使用“this”获取上下文/调用元素
- 在另一个函数中使用变量this
- this.router在AngularJS 2中未定义
- reactjs this.refs vs document.getElementById
- JavaScript 中的嵌套函数和 “this” 关键字
- React+Meteor:this.ops返回未定义
- javascript中对象构造函数中的var属性与this.properties
- 函数中this和var之间的区别
- jQuery(this).Pparent().Pparente().Prent().find()在iPad上不起作用
- Understanding Javascript scope with "var that = this&qu
- 定义this.properties或objectName.properties的javascript JSON对象
- Object.prototype using 'this'
- 在JavaScript类型的函数中避免self-this
- 如何使用(this)访问Angular 2 http rxjs catch函数中的对象属性
- Javascript 对象和 this 关键字
- jQuery使用ajax自动完成问题-TypeError:this.source不是函数
- reactjs无法将this.pops传递到react图表列表中
- 为什么在这种情况下,“This”确实充当javascript函数中的私有成员
- 错误:undefined不是对象(求值'this.props.menuOptions.map')