-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Package: reactIssues related to the Sentry React SDKIssues related to the Sentry React SDK
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Self-hosted/on-premise
Which package are you using?
@sentry/react
SDK Version
7.21.0
Framework Version
React18, react-router-dom v6.4.1
Link to Sentry event
No response
Steps to Reproduce
Greetings.
Seems 7.21.0's wrapCreateBrowserRouter doesn't support errorElement types?
const sentryCreateBrowserRouter = Sentry.wrapCreateBrowserRouter(createBrowserRouter);
const router = sentryCreateBrowserRouter([
{
element: <Wrapper />,
errorElement: <ErrorPage />,
children: [
{
... your createRouterFunction types looks like below.
export declare function wrapCreateBrowserRouter(createRouterFunction: CreateRouterFunction): CreateRouterFunction;
export declare type CreateRouterFunction = (routes: RouteObject[], opts?: any) => Router;
export declare type RouteObject = IndexRouteObject | NonIndexRouteObject;
export interface NonIndexRouteObject {
caseSensitive?: boolean;
children?: RouteObject[];
element?: React.ReactNode | null;
index?: any;
path?: string;
}
export interface IndexRouteObject {
caseSensitive?: boolean;
children?: undefined;
element?: React.ReactNode | null;
index: any;
path?: string;
}the actual RouteObject types of react-router-dom below.
export interface RouteObject extends AgnosticRouteObject {
children?: RouteObject[];
element?: React.ReactNode | null;
errorElement?: React.ReactNode | null;
}Expected Result
Seems errorElement shouldn't emit type error ?
Actual Result
Metadata
Metadata
Assignees
Labels
Package: reactIssues related to the Sentry React SDKIssues related to the Sentry React SDK
