Firebase is pretty quick to load, but if our users are on slow connections, they will see a blank screen until their messages load, and be wondering, "Where are all my awesome chats?" Let's give them a loading indicator.
Inside our ChatContainer, we only want to show the messages if a prop called messagesLoaded is true (which we'll define in a moment). We will make the rendering of our message container conditional on that prop. We can do so using a ternerary statement.
The code looks like this:
// Beginning of ChatContainer ...