Skip to content
This repository was archived by the owner on Sep 23, 2026. It is now read-only.
This repository was archived by the owner on Sep 23, 2026. It is now read-only.

[NextAppProviderPages] Extend Navigate for NextAppProvider to include next/router/TransitionOptions like shallow, locale, scroll. #4748

Open

Description

@marcomele

Summary

When using DashboardLayout with NextAppProvider, NavigationPageItem could allow for extra props to be passed to nextjs router TransitionOptions to control shallow navigation and transition scroll behavior.

Examples

No response

Motivation

No response

Search keywords: next app pages router transition options shallow scroll

Activity

  1. apedroferreira commented on Mar 27, 2025

    @apedroferreira
    Collaborator

    Hi, have you tried using the Link property in the router prop that gets passed to the NextAppProvider, and setting a custom link component there?

    You should be able to use a component kind of like:

    const Link = React.forwardRef<HTMLAnchorElement, LinkProps>((props, ref) => {
      const { href, history, ...rest } = props;
      return <NextLink ref={ref} href={href} replace={history === 'replace'} scroll shallow {...rest} />;
    });

    Other than that we're also adding a renderItem prop to navigation page items, so technically anything can be rendered in their place and any logic can be added.

    Edit: Nevermind, I guess you would need to pass a whole custom router to NextAppProvider in that case. There should be a more straightforward way to do it.

  2. added
    on holdThere is a blocker, we need to wait.
    on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    on holdThere is a blocker, we need to wait.scope: toolpad-coreAbbreviated to "core"

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions