React 0.14.0 & Vanilla Flux
I'm simply doing a check if the user is logged in and if so I'll display their stuff, else I'll show a loading page.
Once the user is loaded in the store a "_onChange" is triggered and "getStateFromStores" will update the user from null to an object.
render: function() {
if(this.state.user !== null){
//Stuff that will be rendered
}
else{
<div>Loading...</div>
}
Yet this if statement will throw an error because this.state.user will be null the first time it checks
Uncaught (in promise) TypeError: Cannot read property '_currentElement' of null
Is there a way to do this type of checks or will I have to create a "userLoaded" boolean or something?