Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/react/src/errorboundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { ReportDialogOptions } from '@sentry/browser';
import { getClient, showReportDialog, withScope } from '@sentry/browser';
import { logger } from '@sentry/core';
import type { Scope } from '@sentry/core';
import hoistNonReactStatics from 'hoist-non-react-statics';
import { hoistNonReactStatics } from './hoist-non-react-statics';
import * as React from 'react';

import { DEBUG_BUILD } from './debug-build';
Expand Down
5 changes: 5 additions & 0 deletions packages/react/src/hoist-non-react-statics.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import * as hoistNonReactStaticsImport from 'hoist-non-react-statics';

// Ensure we use the default export from hoist-non-react-statics if available,
// falling back to the module itself. This handles both ESM and CJS usage.
export const hoistNonReactStatics = hoistNonReactStaticsImport.default || hoistNonReactStaticsImport;
5 changes: 3 additions & 2 deletions packages/react/src/profiler.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { startInactiveSpan } from '@sentry/browser';
import type { Span } from '@sentry/core';
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, spanToJSON, timestampInSeconds, withActiveSpan } from '@sentry/core';
import hoistNonReactStatics from 'hoist-non-react-statics';

import * as React from 'react';

import { REACT_MOUNT_OP, REACT_RENDER_OP, REACT_UPDATE_OP } from './constants';
import { hoistNonReactStatics } from './hoist-non-react-statics';

export const UNKNOWN_COMPONENT = 'unknown';

Expand Down Expand Up @@ -236,4 +237,4 @@ function useProfiler(
}, []);
}

export { withProfiler, Profiler, useProfiler };
export { Profiler, useProfiler, withProfiler };
2 changes: 1 addition & 1 deletion packages/react/src/reactrouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
spanToJSON,
} from '@sentry/core';
import type { Client, Integration, Span, TransactionSource } from '@sentry/core';
import hoistNonReactStatics from 'hoist-non-react-statics';
import { hoistNonReactStatics } from './hoist-non-react-statics';
import * as React from 'react';
import type { ReactElement } from 'react';

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/reactrouterv6-compat-utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
} from '@sentry/core';
import * as React from 'react';

import hoistNonReactStatics from 'hoist-non-react-statics';
import { hoistNonReactStatics } from './hoist-non-react-statics';
import { DEBUG_BUILD } from './debug-build';
import type {
Action,
Expand Down
Loading