From the course: React for Web Designers
Unlock this course with a free trial
Join today to access over 22,500 courses taught by industry experts.
Respond to filter form updates - React.js Tutorial
From the course: React for Web Designers
Respond to filter form updates
- [Instructor] In this video, we're going to add the last major feature of our directory, updating the list of people according to the state of the filters. In larger apps or sites when updating filters, we'd probably batch the changes up a little bit and make a call to an API to retrieve the current list of people. In our case, we're just using a blob of data that's always available, so we have quicker access and can do things a little differently. Switching back to the code, I have a snippet in the exercise files of this video, updatePeopleList.js. I've included this inside a class, just to keep certain editors from throwing errors at you for the syntax, but what we really need is just what's inside this class snippet. Let's copy all this stuff and bring it over to the directory.js file. We'll scroll down to our directory component, and I'll paste it in just below update form state. Save it so that Prettier can work its magic, and now let's take a look at what this actually does. So…
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.
Contents
-
-
-
-
-
Use the mockup, make a plan6m 9s
-
Scaffold initial components5m 58s
-
Functional components6m 37s
-
Build the filters form5m 41s
-
Forms in React: Controlled or not2m 53s
-
Wire up the filters form10m 57s
-
Respond to filter form updates5m 33s
-
Animating with ReactTransitionGroup8m 21s
-
Challenge: Better usability and animation3m 11s
-
Solution: Better usability and animation5m
-
-
-