Skip to content

Conversation

@arndom
Copy link
Contributor

@arndom arndom commented Nov 15, 2025

PR Checklist

This is a WIP. I've implemented the custom routing in the core package and it can be used like below to define routing for all supported routers.

const resources = [
  {
    name: "categories",
    list: "/categories",
    create: "/categories/create",
    edit: "/categories/edit/:id",
    show: "/categories/show/:id",
    custom: ["/categories/custom-1", "/categories/custom-2"], // <==
    meta: {
      canDelete: true,
    },
    },
    {
    name: "settings",
    // list: "/settings",
    custom: ["/settings"], // <==
    meta: {
      canDelete: true,
    },
  },
]

Please check if your PR fulfills the following requirements:

Bugs / Features

What is the current behavior?

No support for custom routes

What is the new behavior?

Support for custom routes

resolves #6864

Notes for reviewers

I have questions/notes regarding the implementation. Some insight from the refine team and issue creator @garrylachman would be appreciated.

Core package custom routing

  • Types, action-route, useNavigation

Documentation/Examples

  • Custom route(s) in a resource with/out CRUD routes
    • When without a list-route, i.e only a custom-route, the resource isn't shown in the sidebar. Should this be accounted for? Since we can use the list route and its component for such cases, instead of a custom one, is it necessary?
  • Should custom routes(s) have options to allow specification of showing in sidebar?
    • Unsure because it differs from existing CRUD routes, as those are just strings.
    • But the utility would be appreciated since the user is going out of their way to create a custom route.

Tests

  • Tests for the example in react, next and remix routers.

@arndom arndom requested a review from a team as a code owner November 15, 2025 20:07
@changeset-bot
Copy link

changeset-bot bot commented Nov 15, 2025

⚠️ No Changeset found

Latest commit: e8bfc2d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link

netlify bot commented Nov 15, 2025

Deploy Preview for refine-doc-live-previews ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit e8bfc2d
🔍 Latest deploy log https://app.netlify.com/projects/refine-doc-live-previews/deploys/6918dd9728b9160008fc7145
😎 Deploy Preview https://deploy-preview-7118--refine-doc-live-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@arndom arndom changed the title feat(core): add support for custom routes to routing handlers feat(core): custom routes support Nov 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Custom resource routes

1 participant