Introduction to Tack Router
Creating a Search Page
Defining and Validating Query Parameters
Using Libraries for Validation
Managing State with Query Parameters
Final Implementation
This video is part of a series on Tack Router, with the next episode focusing on authenticated routes, which will cover access control based on user permissions.
0:00 query parameters can now entirely replace your state manager with tack router welcome to the third episode of this series on tanack rotor today we're going to see how this Library will help us defining and validating query parameters and how they can basically act as a state manager in short by sending the URL of your application you can immediately send a snapshot of your state with basically everyone enough up talking let's start coding we can create immedately a search. 6 page and as usual
0:32 if you run mpm run Dev our VD plugin will basically generate the file for us so now that we have this root we can create a link in our root let's create a link here so that we can access to our page there it is if we open the browser we can find okay here if I click search Hello search and this is our page now let's configure our query parameters the first thing you might want to do is well
1:03 we're defining what is considered as valid so why not just creating a type in this case this type has a couple primitive values and another subtype with a union of literals now how can we tell T router that we only want query parameters that are exactly matching this type as usual in the create fire root there are quite a lot of method you can add here and if you search for validate search well this is exactly the
🔒 The full, searchable transcript is available with Pro.