Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// JSON Object
{
"crate": {
"toolbar": {
"title": "Farm Overview"
}
}
}
// Component
componentWillMount() {
fetch('/crate', { method: 'get' })
.then(r => r.json())
.then(data => this.setState({ crate: data }))
.catch(e => console.error(this.state, e.toString())
)
}
render() {
return (
<div>
{this.state.crate.toolbar.title}
</div>
)
}
// "TypeError: Cannot read property '_currentElement' of null"
//
// However, I can see the object in my browser console...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.