Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
3 tasks done
AdrianMachado opened this issue Dec 5, 2022 · 1 comment · Fixed by #6439
Closed
3 tasks done

Comments

@AdrianMachado
Copy link

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 :)

@AbhiPrasad
Copy link
Member

Hey, thanks for writing in! @onurtemizkan could you take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants