Skip to content

[Content]: There's a usage example with errors for MatchFilter usage #1259

@bruno-preti-glb

Description

@bruno-preti-glb

📚 Subject area/topic

/guides/routing-and-navigation.mdx

📋 Page(s) affected (or suggested, for new content)

https://docs.solidjs.com/guides/routing-and-navigation

📋 Description of content that is out-of-date or incorrect

In the MatchFilter usage example the following code has two issues:

import { Router, Route } from "@solidjs/router";
import type { SegmentValidators } from "./types";

const User = lazy(() => import("./pages/User"));

const filters: MatchFilters = {
  parent: ["mom", "dad"], // allow enum values
  id: /^\d+$/, // only allow numbers
  withHtmlExtension: (v: string) => v.length > 5 && v.endsWith(".html"), // only `*.html` extensions wanted
};
  1. SegmentValidators is imported from a file that is not included in the example and, in addition, it's not used in the code.
  2. MatchFilters is not imported.

🖥️ Reproduction in StackBlitz (if reporting incorrect content or code samples)

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions