Skip to content

[Feature]: Use React Routers 6.27 viewTransition prop #1552

Open
@chenjiahan

Description

What problem does this feature solve?

Since React Router 6.27.0, using View Transition API requires only adding viewTransition prop to Link component:

<Link to={to} viewTransition>
  Click me
</Link>

It can replace the current useViewTransition hook in Rspress, and this should fix the current runtime error logs when using themeConfig.enableContentAnimation:

Image

What does the proposed API look like?

  • Using the viewTransition prop
  • The React Router document also notes that viewTransition only works when using a data router, see Picking a Router.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions