React: Building Modern Web Applications
by Jonathan Hayward, Artemij Fedosejev, Narayan Prusty, Adam Horton, Ryan Vice, Ethan Holmes, Tom Bray
Searching posts
Remember that little search box we slipped into the header in our wireframes? We also made the post list a separate component since it appears both on our home view as well as in the user view.
Now, we'll wire that search field to the post list component. The search box is always there, while the post list comes and goes. This is an opportunity to use a store for a purely front-end concern. The search information in the header bar is just a piece of data that various ephemeral components in the application will potentially need. It's like any other application model managed by a store, except that it's not backed by a server request.
The final application code, including the search feature, can be found in the ch9-2.zip code bundle. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access