App Component: Connecting to the Back-end
Explore how to build a React app component that connects to a Flask back-end. Learn to set up client state, use axios for API calls, handle POST requests, and manage Cross-Origin Request Sharing errors during development.
We'll cover the following...
We'll cover the following...
Set up the default opening state
To start, we’ll create the sign-in page as the default opening state. We do this by setting the gameStatus state property to be logged out. The `SignInScreen takes a callback function that will be called when the user clicks on the “Start a Game” button. That function must take two arguments: a user name and a language. For now, we can just accept it and log it to the console.
Installing axios
When we run ...