Skip to content

Global handle function for Remix/React Router v7 #18

@mateussilva92

Description

@mateussilva92

Currently, sitemap generation for Remix / React Router v7 only supports handle functions defined on individual routes.

This works well when route-specific logic is needed, but there’s no way to apply shared logic across all routes.

A common example is generating alternate language links: every route may need the same set of alternates, yet today this logic has to be duplicated in each route’s handle.

One possible approach to support this use case would be to allow using the handle from root.tsx, which would run if the individual route doesn't have sitemap handle to be processed.

Let me know if this approach makes sense for the project.

I've already opened a PR for this, is shows best the approach taken,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions