From the course: Build Modern Web Apps with React, Hooks, State Management, and APIs Using Vite or Next.js

Unlock this course with a free trial

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

Users component and demo

Users component and demo

Welcome back. Now inside our components, we have to have our users component, which can call this reducer and give us our users list. So inside this components, we are going to add another component and we'll call it users .tsx do our afce and we have our users component ready. Now let's implement this. We have to get the dispatch function so we can actually call an action. We had set up a useAppDispatch hook. We can call it here to get the dispatch function. After that, we need to have some destructured items for initial state and we can do that from use app selector hook. It is going to take a state and return the state dot uses and we can destructure the items loading an error from it. After that, we have to write some of the conditions. Let's quickly set up our users listing with some good styling. So we can do a div of class name and give it a padding of 6. After that we are going to have an h2 and we can give it a class name of x-2xl, font is going to be bold, a margin bottom of…

Contents