Exercise: Form Validation and Context Management
Use what you've learned in this chapter to complete this coding exercise.
We'll cover the following...
Problem statement
Our e-commerce website currently lacks login functionality for the users. Our objective is to facilitate user login and provide real-time error messages and personalized experience. The objective can be broken down into the following tasks:
Enable login: You’ll create a login mechanism using Next.js and the Context API. The user should be able to log in by providing valid
username
andpassword
fields.Manage state: Upon login, the
username
along with other data should be maintained across the application to provide a personalized feel to them.Update cart name: The name of the ...