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. ...
Get React: Building Modern Web Applications now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.