From the course: Spring Boot and React: Build Scalable and Dynamic Web Apps
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Solution: Component
From the course: Spring Boot and React: Build Scalable and Dynamic Web Apps
Solution: Component
(upbeat music) - [Instructor] Now it's time for my solution to this challenge. I want to start with a little bit of a utility that I created. You'll notice that there was a couple of price values that came across and I don't like them displaying just as numbers. So I went and created a function that takes that number and returns an international currency. I am using ENUS 'cause that is my locale. Obviously you can change this to match your local currency if you want to do that. I also in App.js added the routes for products, services, and vendors. On my homepage I put links to those things. And now let's start with products. So you'll notice on products, I have two state elements. I've got one for products and one for vendors. And for vendors I chose to use a map, and I'll show you why here in a moment. So I went through, so I created a useLayoutEffect and I went and grabbed all of the products. I also grabbed all of…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.