Type Route

Type Route

  • Docs
  • GitHub
  • v0.6.0

›Types

Introduction

  • Getting Started
  • Simple React Example

Guides

  • Code Splitting
  • Complex Route Parameters
  • Custom Link Behavior
  • Custom Query String
  • Data Fetching
  • Nested and Similar Routes
  • No Match (404)
  • Page Layout
  • Preventing Navigation
  • Programmatic Navigation
  • Redirects
  • Rendering Links
  • Route Parameters
  • Scroll Restoration
  • Server Side Rendering
  • Styling of Links for the Currently Active Route
  • Type Route without React
  • Wildcard Routes
  • Previous Release Docs
  • Guide Missing?

API Reference

    <ParameterDefinition>

    • param

    <RouteDefinition>

    • defineRoute
    • extend

    <RouteGroup>

    • createGroup
    • has

    <Route>

    • action
    • href
    • link
    • name
    • params
    • push
    • replace

    <Router>

    • createRouter
    • useRoute
    • RouteProvider
    • routes
    • session

    Types

    • Link
    • QueryStringSerializer
    • Route
    • RouterOpts
    • SessionOpts
    • ValueSerializer

    Miscellaneous

    • noMatch
    • preventDefaultLinkClickBehavior
Edit

QueryStringSerializer

See custom query string.

/**
 * Object for configuring a custom query string serializer. You likely
 * do not need this level of customization for your application.
 */
export type QueryStringSerializer = {
  /**
   * Accepts the query string (without the leading ?) and returns
   * a mapping of parameter names to unserialized parameter values.
   * Individual parameter value serializer take care of the parsing
   * parameter values. A null value indicates an empty array.
   */
  parse: (raw: string) => Record<string, string | null>;

  /**
   * Accepts an object keyed by query parameter names and generates
   * a stringified version of the object. A null value indicates an
   * empty array.
   */
  stringify: (
    queryParams: Record<
      string,
      { valueSerializerId?: string; array: boolean; value: string | null }
    >
  ) => string;
};
← LinkRoute →
Type Route is a Type Hero project  ·  Copyright © 2020