Skip to content

Commit

Permalink
fix(react): provide displayName for our core components (#1423)
Browse files Browse the repository at this point in the history
Adds `.displayName` property to our core SDK components.
This should make it easier to debug our SDK in production/minified environments.

Context:
https://getstream.slack.com/archives/C06CF5TKRGA/p1719396728909279
  • Loading branch information
oliverlaz authored Jun 26, 2024
1 parent 8184fe1 commit 724c444
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/react-sdk/src/core/components/Audio/Audio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ export const Audio = ({
/>
);
};

Audio.displayName = 'Audio';
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,5 @@ export const ParticipantsAudio = (props: ParticipantsAudioProps) => {
</>
);
};

ParticipantsAudio.displayName = 'ParticipantsAudio';
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ const ParticipantOverlay = (props: {
);
};

LivestreamLayout.displayName = 'LivestreamLayout';

const useUpdateCallDuration = () => {
const { useIsCallLive, useCallSession } = useCallStateHooks();
const isCallLive = useIsCallLive();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,5 @@ export const PaginatedGridLayout = (props: PaginatedGridLayoutProps) => {
</div>
);
};

PaginatedGridLayout.displayName = 'PaginatedGridLayout';
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ export const SpeakerLayout = ({
);
};

SpeakerLayout.displayName = 'SpeakerLayout';

type ScrollButtonsProps<T extends HTMLElement> = {
scrollWrapper: T | null;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,5 @@ export const ParticipantView = forwardRef<HTMLDivElement, ParticipantViewProps>(
);
},
);

ParticipantView.displayName = 'ParticipantView';
12 changes: 10 additions & 2 deletions packages/react-sdk/src/core/components/StreamCall/StreamCall.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import { StreamCallProvider } from '@stream-io/video-react-bindings';
import { ComponentType, PropsWithChildren } from 'react';
import {
StreamCallProvider,
StreamCallProviderProps,
} from '@stream-io/video-react-bindings';

// re-exporting the StreamCallProvider as StreamCall
export const StreamCall = StreamCallProvider;
export const StreamCall: ComponentType<
PropsWithChildren<StreamCallProviderProps>
> = StreamCallProvider;

StreamCall.displayName = 'StreamCall';
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
StreamVideoProvider,
StreamVideoProps,
StreamVideoProvider,
} from '@stream-io/video-react-bindings';
import { PropsWithChildren } from 'react';
import { translations } from '../../../translations';
Expand All @@ -10,3 +10,5 @@ export const StreamVideo = (props: PropsWithChildren<StreamVideoProps>) => {
<StreamVideoProvider translationsOverrides={translations} {...props} />
);
};

StreamVideo.displayName = 'StreamVideo';
2 changes: 2 additions & 0 deletions packages/react-sdk/src/core/components/Video/Video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,5 @@ export const Video = ({
</>
);
};

Video.displayName = 'Video';

0 comments on commit 724c444

Please sign in to comment.