Match route on search params?
I'd like to render either of two components depending on if a search parameter is present.
For example:
-
-
(I have no control over the URL structure and cannot, say, change to something like path params)
Is this achievable with
For example:
-
/books should render component <BookList />-
/books?id=123 should render component <Book id={123} />(I have no control over the URL structure and cannot, say, change to something like path params)
Is this achievable with
createRoute? I could do this with logic inside common parent component, but this feels brittle and feels like it is a responsibility of the router.