课程: React: Creating and Hosting a Full-Stack Site (2022)

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Build a create-account page

Build a create-account page

- All right. So now that we've added a custom hook for keeping track of our users off state and we've added a little bit of logic to our article page to change the structure of the page depending on whether the user is logged in or not. The next thing that we're going to do is allow users that don't have an account yet to create an account by going into the create account page and implementing it. So let's open up our create account page. And the good news here is that a lot of this is going to be pretty repetitive from the login page. So if you want what you can actually do is copy a lot of this code and I'm just going to copy the top two imports here use state link and use navigate. We're going to paste those up here in the create account page. Like, so, and then we're going to copy the state variables here. So email, password, and error, and we're going to paste those in our create account page as well. And actually…

内容