Skip to content

Commit 2341863

Browse files
committed
fix(react): Fix displayName
1 parent 6df8930 commit 2341863

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44

55
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
6+
- [react] feat: Add @sentry/react package (#2631)
67

78
## 5.16.0
89

packages/react/src/profiler.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ interface ProfilerProps {
6666

6767
class Profiler extends React.Component<ProfilerProps> {
6868
public activity: number | null;
69-
7069
public constructor(props: ProfilerProps) {
7170
super(props);
7271

@@ -101,14 +100,11 @@ class Profiler extends React.Component<ProfilerProps> {
101100
}
102101
}
103102

104-
function withProfiler<P extends object>(
105-
WrappedComponent: React.ComponentType<P>,
106-
profilerProps?: ProfilerProps,
107-
): React.FC<P> {
103+
function withProfiler<P extends object>(WrappedComponent: React.ComponentType<P>): React.FC<P> {
108104
const componentDisplayName = WrappedComponent.displayName || WrappedComponent.name || UNKNOWN_COMPONENT;
109105

110106
const Wrapped: React.FC<P> = (props: P) => (
111-
<Profiler componentDisplayName={componentDisplayName} {...profilerProps}>
107+
<Profiler componentDisplayName={componentDisplayName}>
112108
<WrappedComponent {...props} />
113109
</Profiler>
114110
);

packages/react/test/profiler.test.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,6 @@ describe('withProfiler', () => {
6666
op: 'react',
6767
});
6868
});
69-
70-
it('is called with a custom displayName', () => {
71-
const ProfiledComponent = withProfiler(() => <h1>Hello World</h1>, { componentDisplayName: 'Test' });
72-
73-
create(<ProfiledComponent />);
74-
expect(mockPushActivity).toHaveBeenLastCalledWith('Test', expect.objectContaining({ description: '<Test>' }));
75-
});
7669
});
7770
});
7871
});

0 commit comments

Comments
 (0)