React - Minified exception occurred

前端 未结 10 1423
离开以前
离开以前 2020-12-09 07:54

I have React js installed via NPM and using browserify to manage components in react. When an exception occurs in React, the console shows as

\"Uncau

10条回答
  •  天命终不由人
    2020-12-09 08:16

    I got this error when my render method returned undefined eg

    render() {
        let view;
        // Not paying attention and slip a case where view won't get assigned a value
        if(this.props.foo == 'hello') {
            view = 
        }
        else if(this.props.foo == 'bye') {
            view = 
        }
        return view;
    }
    

    This will trigger the error when this.props.foo is 'hi'

提交回复
热议问题