Skip to content

Version 7.23.0: React Router's encodeLocation is missing in Sentry Router object #6421

Closed
@AdrianMachado

Description

@AdrianMachado

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/react

SDK Version

7.23.0

Framework Version

React18, react-router-dom v6.4.4

Link to Sentry event

No response

Steps to Reproduce

  1. Follow instructions for usage with React Router 6.4 API here
  2. Once you have set up your router object (of type Router), you will then use it in a RouterProvider component as such
<RouterProvider router={router} />

See docs

Expected Result

No type errors on the RouterProvider

Actual Result

Observe the type error
image
It seems like the type error is due to a new introduction of encodeLocation on the Router type in React Router DOM.

/**
     * @internal
     * PRIVATE - DO NOT USE
     *
     * Utility function to URL encode a destination path according to the internal
     * history implementation
     * @param to
     */
    encodeLocation(to: To): Path;

I believe it was added in this PR. Hope this helps :)

Metadata

Metadata

Assignees

Labels

Package: reactIssues related to the Sentry React SDK

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions