Starting from:

$9.99+

Solid Router: The Complete Guide

A practical guide to Solid Router for building fast, reactive, and maintainable navigation in SolidJS apps.

Master Solid Router with this focused, hands-on guide. Learn the fundamentals of route configuration, navigation, and parameters, then dive into advanced topics like data loading, async handling, prefetching, and performance tuning. Whether building SolidJS SPAs or SolidStart apps, this book equips you with the practical skills to ship fast, scalable, production-ready experiences.

Every modern web application needs navigation. Whether it is a small single-page app or a full-fledged platform with nested layouts, dynamic segments, and preloaded data, routing is the connective tissue that ties the user experience together. In the SolidJS world, that job is handled by Solid Router.

This book provides a focused and practical guide to Solid Router.

The content presented here is adapted from my larger work, SolidJS: The Complete Guide. In that book, routing is covered alongside the broader fundamentals of SolidJS, including reactivity, component design, state management, server-side rendering. Because routing is a distinct and essential subject, I have extracted the original chapter to serve as a standalone reference for developers who wish to study this topic in depth.

If you are already comfortable with SolidJS basics and want to dive straight into building real applications with routing, this book is for you. It is lean, focused, and ready to get you up and running.

Print Length: 122 Pages

Payment & Security

All purchases are processed securely through Stripe, a trusted global payment platform. Stripe uses advanced encryption and is PCI DSS compliant, ensuring your payment information is always safe. We never store or have access to your credit card details, so you can buy with complete confidence.

Table of Contents

  • 1. Introduction
    1. Code Examples
    2. Contact and Feedback
    3. Requirements
    4. Trying Solid via Online Playground
    5. Creating a Project From a Template
    6. Note For React Developers
  • 02. Solid Router
    1. Setting Up Development Environment
      1. Client-Only Development Environment
      2. SolidStart Development Environment
    2. Installing Solid Router
    3. Routing Strategies
    4. Anatomy of a URL
      1. Clean URLs
    5. Introducing the Router Component
      1. Error Handling Considerations
    6. Defining Routes
    7. Lazy Loading Route Components
    8. Matching Dynamic Paths
    9. Filtering Dynamic Paths
    10. Optional Parameters
    11. Catch-All Routes and Handling 404s
      1. Named Wildcards for Flexibility
      2. Wildcards Beyond Catch-All Routes
      3. Use Cases for Wildcard Routes
      4. Matching Multiple Paths in a Route
      5. Attaching Metadata
    12. Layouts
      1. Rendering Different Layouts Conditionally
      2. Rendering Different Layouts via Nested Routes
    13. Nested Routes
      1. Providing a Shared Layout
      2. Nested Routes via Configuration
    14. Alternative Routers
      1. Hash Mode Router
      2. Memory Router
    15. Linking and Navigation
      1. Using Anchor Elements
        1. Targeting New Tabs or Frames
        2. Adding Keyboard Shortcuts with accesskey
        3. Security Considerations for Anchor Elements
      2. Using the A Component
      3. Programmatic Navigation
      4. The redirect Function
        1. Using redirect in Queries and Actions
        2. Single Flight Mutations
        3. throw vs return
    16. Hosting Apps in Subdirectories
    17. Preloading
      1. Inside the preload Function
      2. Manually Preloading with usePreloadRoute
    18. Accessing Route Related Data
      1. Accessing URL Information with useLocation
      2. Managing Query Parameters with useSearchParams
      3. Extracting Route Parameters with useParams
      4. Matching Routes with useMatch and useCurrentMatches
    19. Displaying Transition Indicators
    20. Intercepting Route Changes with useBeforeLeave
    21. Fetching Async Data
    22. Deduplicated Data Fetching
    23. Updating Remote Data With Web Forms
      1. Working With Web Forms
      2. Collecting User Inputs and Performing Data Updates
      3. Providing Unique Names For Serialization
      4. Passing Arguments Directly
      5. Programmatically Invoking Actions
      6. Handling Form Errors
      7. Helper Functions
      8. Tracking Form Submissions with useSubmission and useSubmissions
    24. Reactive Forms with Authentication and Validation