Learn React with TypeScript - Second Edition by Carl Rippon
Author:Carl Rippon
Language: eng
Format: epub
Publisher: Packt Publishing Pvt. Ltd.
Published: 2023-02-21T00:00:00+00:00
We no longer need setSearchParams because the setting of the search parameter is included in the navigation path, so remove this from the useSearchParams call: const [searchParams] = useSearchParams();
In the running app, enter some search criteria in the search box and press Enter to submit the search.
The search parameter is used to navigate to the products list page. When the products list page appears, the correctly filtered products are shown:
Figure 6.15 â Products list page with filter products
So, programmatic navigation is achieved using the useNavigate hook. This returns a function that can navigate to the path passed into it.
For more information on the useNavigate hook, see the following link in the React Router documentation: https://reactrouter.com/en/main/hooks/use-navigate.
Next, we will refactor the search formâs navigation to use React Routerâs Form component.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
ActiveX | ASP.NET |
Cold Fusion | CSS |
DHTML | Java Server Pages |
JavaScript | PHP |
Python | Ruby |
XSL |
Hello! Python by Anthony Briggs(9904)
The Mikado Method by Ola Ellnestam Daniel Brolund(9769)
Dependency Injection in .NET by Mark Seemann(9329)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7771)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7550)
Svelte with Test-Driven Development by Daniel Irvine(7088)
Test-Driven Development with PHP 8 by Rainier Sarabia(6817)
Layered Design for Ruby on Rails Applications by Dementyev Vladimir;(6684)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(6530)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6399)
Web Development with Django by Ben Shaw Saurabh Badhwar(6150)
React Application Architecture for Production by Alan Alickovic(5870)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(5802)
Kotlin in Action by Dmitry Jemerov(5048)
Audition by Ryu Murakami(4583)
Software Architecture for Web Developers by Mihaela Roxana Ghidersa(4411)
Hands-On Full-Stack Web Development with GraphQL and React by Sebastian Grebe(4313)
Accelerating Server-Side Development with Fastify by Manuel Spigolon Maksim Sinik & Matteo Collina(4264)
Functional Programming in JavaScript by Mantyla Dan(4037)
