I am planning to use my state as a form of signaling that I will gonna change back and forth to show my loading screen, main form and success or error message. But not sure if this is the best practice. Here is a sample code
div hidden={this.state.FormStatus.statusMode !== "Loading"}>
<LoadingScreen />
</div>
div hidden={this.state.FormStatus.statusMode !== "Main"}>
<MainForm/>
</div>
But I am not sure if this is the best way, I am worried that it can slowdown my application or eat my clients CPU with this one. Can you suggest better method?