I got this error several times and it seems to happen when I access a property that does not exist in the render function yet. My application uses React / Redux and ImmmutableJS, and there are many AJAX calls that occur on mounting any given component, so I have to be sure that I exit the render function until everything finishes loading. For example, I get the error in question when I have this:
render () { const displayName = this.props.myObject.get('displayName') if (this.props.loading) return <Loading /> return <div>{displayName}</div> }
But not when I switch the download check:
render () { if (this.props.loading) return <Loading /> const displayName = this.props.myObject.get('displayName') return <div>{displayName}</div> }
Verifying the existence of an object also helps get rid of this annoying error.
Laurelb
source share