Conditional rendering
Pay attention to the Busy
component's render
function. It includes conditional rendering, which you have not yet used in React:
{this.state.busy && <Busy />}
When this.state.busy
is false
, the expression resolves as false
. React ignores Booleans while rendering, and hence the expression doesn't render anything in this case. Otherwise, when busy is true
, the expression resolves to the busy
component, which in turn renders.
Â
Â