From the course: Building UI Components with Storybook: Master React Components and UI Design with Storybook for Better Efficiency

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Input dynamic tests and events with React

Input dynamic tests and events with React

Great work making it this far. If some of this is making sense to you, fantastic. Even if you constantly have to go back or go through it again, totally normal, especially if you're new, to react. We've taken a look at how state management can work locally here. That's great. We're conditionally rendering, but we still have to change these values in the back here in our code. What we want instead is now that we have the state set up, we want the user to be able to type into an input, put in a password, hit enter, and then conditionally change the rendering. How do we do that? Well, the first thing we need is an input field, I would imagine. We need to have an input field that can handle that. What we're going to do is we're going to create an input field above our title over here that essentially has a button. So when the user goes to the homepage, they can see some stuff. If they put in a password, then they get special access to the contact page, something like that. and they get…

Contents