【发布时间】:2016-07-10 10:00:26
【问题描述】:
每当我尝试访问 undefined 时,React + ES6 Babel 都会吐出以下错误消息(例如尝试 person.age where person === undefined.)
当我输入错误的 import 语句或在解构 props 对象时出错时也会发生这种情况。例如,我可能会犯以下错误:
const { name, age } = this.props.person
// but `this.props.person` only has a `name` property.
这样缺少错误消息是一种痛苦。有没有我错过设置的选项?大家是如何应对这个问题的?
【问题讨论】:
标签: reactjs ecmascript-6 babeljs