App Component: Changing Screens
Let's learn how to toggle between different screens depending on the state.
We'll cover the following
We require two calls to the API. This is a side-effect of how the API was designed. In particular, a newly created game only returns the game ID and doesn’t give the other information needed to populate the game-playing screen. This is simply addressed here by making a second request from the API.
Changing the application screen
Now, when a name and language are chosen, the screen changes to state that the game status is active. This leads to the next step, where we deploy the `PlayScreen. We must include the import for the second screen. We add these one at a time to avoid an error from importing something but not using it.
Get hands-on with 1200+ tech skills courses.