Skip to content

Commit

Permalink
Remove useForwardedRef redeclaration (#839)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasIO authored Apr 22, 2024
1 parent c78ce03 commit c2ad1ae
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 26 deletions.
5 changes: 5 additions & 0 deletions .changeset/silver-buses-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@livekit/components-react": patch
---

Remove useForwardedRef redeclaration
40 changes: 20 additions & 20 deletions packages/react/etc/components-react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export interface AudioConferenceProps extends React_2.HTMLAttributes<HTMLDivElem
}

// @public
export const AudioTrack: (props: AudioTrackProps & React_2.RefAttributes<HTMLAudioElement>) => React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | null;
export const AudioTrack: React_2.ForwardRefExoticComponent<AudioTrackProps & React_2.RefAttributes<HTMLAudioElement>>;

// @public (undocumented)
export interface AudioTrackProps extends React_2.AudioHTMLAttributes<HTMLAudioElement> {
Expand All @@ -61,7 +61,7 @@ export interface AudioTrackProps extends React_2.AudioHTMLAttributes<HTMLAudioEl
}

// @public
export const AudioVisualizer: (props: AudioVisualizerProps & React_2.RefAttributes<SVGSVGElement>) => React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | null;
export const AudioVisualizer: React_2.ForwardRefExoticComponent<AudioVisualizerProps & React_2.RefAttributes<SVGSVGElement>>;

// @public (undocumented)
export interface AudioVisualizerProps extends React_2.HTMLAttributes<SVGElement> {
Expand Down Expand Up @@ -100,7 +100,7 @@ export function Chat({ messageFormatter, messageDecoder, messageEncoder, channel
export const ChatCloseIcon: (props: SVGProps<SVGSVGElement>) => React_2.JSX.Element;

// @public
export const ChatEntry: (props: ChatEntryProps & React_2.RefAttributes<HTMLLIElement>) => React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | null;
export const ChatEntry: React_2.ForwardRefExoticComponent<ChatEntryProps & React_2.RefAttributes<HTMLLIElement>>;

// @public
export interface ChatEntryProps extends React_2.HTMLAttributes<HTMLLIElement> {
Expand Down Expand Up @@ -134,7 +134,7 @@ export interface ChatProps extends React_2.HTMLAttributes<HTMLDivElement>, ChatO
}

// @public
export const ChatToggle: (props: ChatToggleProps & React_2.RefAttributes<HTMLButtonElement>) => React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | null;
export const ChatToggle: React_2.ForwardRefExoticComponent<ChatToggleProps & React_2.RefAttributes<HTMLButtonElement>>;

// @public (undocumented)
export interface ChatToggleProps extends React_2.ButtonHTMLAttributes<HTMLButtonElement> {
Expand All @@ -146,14 +146,14 @@ export interface ChatToggleProps extends React_2.ButtonHTMLAttributes<HTMLButton
export const Chevron: (props: SVGProps<SVGSVGElement>) => React_2.JSX.Element;

// @public
export const ClearPinButton: (props: ClearPinButtonProps & React_2.RefAttributes<HTMLButtonElement>) => React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | null;
export const ClearPinButton: React_2.ForwardRefExoticComponent<ClearPinButtonProps & React_2.RefAttributes<HTMLButtonElement>>;

// @public (undocumented)
export interface ClearPinButtonProps extends React_2.ButtonHTMLAttributes<HTMLButtonElement> {
}

// @public
export const ConnectionQualityIndicator: (props: ConnectionQualityIndicatorProps & React_2.RefAttributes<HTMLDivElement>) => React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | null;
export const ConnectionQualityIndicator: React_2.ForwardRefExoticComponent<ConnectionQualityIndicatorProps & React_2.RefAttributes<HTMLDivElement>>;

// @public (undocumented)
export interface ConnectionQualityIndicatorOptions {
Expand All @@ -166,7 +166,7 @@ export interface ConnectionQualityIndicatorProps extends React_2.HTMLAttributes<
}

// @public
export const ConnectionState: (props: ConnectionStatusProps & React_2.RefAttributes<HTMLDivElement>) => React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | null;
export const ConnectionState: React_2.ForwardRefExoticComponent<ConnectionStatusProps & React_2.RefAttributes<HTMLDivElement>>;

// @public
export function ConnectionStateToast(props: ConnectionStateToastProps): React_2.JSX.Element;
Expand Down Expand Up @@ -206,7 +206,7 @@ export interface ControlBarProps extends React_2.HTMLAttributes<HTMLDivElement>
}

// @public
export const DisconnectButton: (props: DisconnectButtonProps & React_2.RefAttributes<HTMLButtonElement>) => React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | null;
export const DisconnectButton: React_2.ForwardRefExoticComponent<DisconnectButtonProps & React_2.RefAttributes<HTMLButtonElement>>;

// @public (undocumented)
export interface DisconnectButtonProps extends React_2.ButtonHTMLAttributes<HTMLButtonElement> {
Expand Down Expand Up @@ -242,7 +242,7 @@ export interface FocusLayoutProps extends React_2.HTMLAttributes<HTMLElement> {
}

// @public
export const FocusToggle: (props: FocusToggleProps & React_2.RefAttributes<HTMLButtonElement>) => React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | null;
export const FocusToggle: React_2.ForwardRefExoticComponent<FocusToggleProps & React_2.RefAttributes<HTMLButtonElement>>;

// Warning: (ae-internal-missing-underscore) The name "FocusToggleIcon" should be prefixed with an underscore because the declaration is marked as @internal
//
Expand Down Expand Up @@ -307,9 +307,9 @@ export type LayoutContextType = {
export const LeaveIcon: (props: SVGProps<SVGSVGElement>) => React_2.JSX.Element;

// @public
export const LiveKitRoom: (props: LiveKitRoomProps & {
export const LiveKitRoom: React_2.ForwardRefExoticComponent<LiveKitRoomProps & {
children?: React_2.ReactNode;
} & React_2.RefAttributes<HTMLDivElement>) => React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | null;
} & React_2.RefAttributes<HTMLDivElement>>;

// @public (undocumented)
export interface LiveKitRoomProps extends Omit<React_2.HTMLAttributes<HTMLDivElement>, 'onError'> {
Expand Down Expand Up @@ -374,7 +374,7 @@ export interface MediaDeviceMenuProps extends React_2.ButtonHTMLAttributes<HTMLB
}

// @public
export const MediaDeviceSelect: (props: MediaDeviceSelectProps & React_2.RefAttributes<HTMLUListElement>) => React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | null;
export const MediaDeviceSelect: React_2.ForwardRefExoticComponent<MediaDeviceSelectProps & React_2.RefAttributes<HTMLUListElement>>;

// @public (undocumented)
export interface MediaDeviceSelectProps extends Omit<React_2.HTMLAttributes<HTMLUListElement>, 'onError'> {
Expand Down Expand Up @@ -427,7 +427,7 @@ export interface MultiBandTrackVolumeOptions {
}

// @public
export const ParticipantAudioTile: (props: ParticipantTileProps & React_2.RefAttributes<HTMLDivElement>) => React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | null;
export const ParticipantAudioTile: React_2.ForwardRefExoticComponent<ParticipantTileProps & React_2.RefAttributes<HTMLDivElement>>;

// Warning: (ae-internal-missing-underscore) The name "ParticipantClickEvent" should be prefixed with an underscore because the declaration is marked as @internal
//
Expand Down Expand Up @@ -457,7 +457,7 @@ export interface ParticipantLoopProps {
}

// @public
export const ParticipantName: (props: ParticipantNameProps & React_2.RefAttributes<HTMLSpanElement>) => React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | null;
export const ParticipantName: React_2.ForwardRefExoticComponent<ParticipantNameProps & React_2.RefAttributes<HTMLSpanElement>>;

// @public (undocumented)
export interface ParticipantNameProps extends React_2.HTMLAttributes<HTMLSpanElement>, UseParticipantInfoOptions {
Expand All @@ -469,7 +469,7 @@ export interface ParticipantNameProps extends React_2.HTMLAttributes<HTMLSpanEle
export const ParticipantPlaceholder: (props: SVGProps<SVGSVGElement>) => React_2.JSX.Element;

// @public
export const ParticipantTile: (props: ParticipantTileProps & React_2.RefAttributes<HTMLDivElement>) => React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | null;
export const ParticipantTile: React_2.ForwardRefExoticComponent<ParticipantTileProps & React_2.RefAttributes<HTMLDivElement>>;

// @public (undocumented)
export interface ParticipantTileProps extends React_2.HTMLAttributes<HTMLDivElement> {
Expand Down Expand Up @@ -550,7 +550,7 @@ export interface RoomAudioRendererProps {
export const RoomContext: React_2.Context<Room | undefined>;

// @public
export const RoomName: (props: RoomNameProps & React_2.RefAttributes<HTMLSpanElement>) => React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | null;
export const RoomName: React_2.ForwardRefExoticComponent<RoomNameProps & React_2.RefAttributes<HTMLSpanElement>>;

// @public (undocumented)
export interface RoomNameProps extends React_2.HTMLAttributes<HTMLSpanElement> {
Expand Down Expand Up @@ -586,7 +586,7 @@ export function setLogLevel(level: LogLevel, options?: SetLogLevelOptions): void
export const SpinnerIcon: (props: SVGProps<SVGSVGElement>) => React_2.JSX.Element;

// @public
export const StartAudio: (props: AllowAudioPlaybackProps & React_2.RefAttributes<HTMLButtonElement>) => React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | null;
export const StartAudio: React_2.ForwardRefExoticComponent<AllowAudioPlaybackProps & React_2.RefAttributes<HTMLButtonElement>>;

// @public
export function Toast(props: React_2.HTMLAttributes<HTMLDivElement>): React_2.JSX.Element;
Expand All @@ -601,7 +601,7 @@ export interface TrackLoopProps {
}

// @public
export const TrackMutedIndicator: (props: TrackMutedIndicatorProps & React_2.RefAttributes<HTMLDivElement>) => React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | null;
export const TrackMutedIndicator: React_2.ForwardRefExoticComponent<TrackMutedIndicatorProps & React_2.RefAttributes<HTMLDivElement>>;

// @public (undocumented)
export interface TrackMutedIndicatorProps extends React_2.HTMLAttributes<HTMLDivElement> {
Expand Down Expand Up @@ -629,7 +629,7 @@ export type TrackReferenceOrPlaceholder = TrackReference | TrackReferencePlaceho
// Warning: (ae-forgotten-export) The symbol "ToggleSource" needs to be exported by the entry point index.d.ts
//
// @public
export const TrackToggle: <T extends ToggleSource>(props: TrackToggleProps<T> & React_2.RefAttributes<HTMLButtonElement>) => React_2.ReactElement | null;
export const TrackToggle: React_2.ForwardRefExoticComponent<TrackToggleProps<ToggleSource> & React_2.RefAttributes<HTMLButtonElement>>;

// @public (undocumented)
export interface TrackToggleProps<T extends ToggleSource> extends Omit<React_2.ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {
Expand Down Expand Up @@ -1126,7 +1126,7 @@ export interface VideoConferenceProps extends React_2.HTMLAttributes<HTMLDivElem
}

// @public
export const VideoTrack: (props: VideoTrackProps & React_2.RefAttributes<HTMLVideoElement>) => React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | null;
export const VideoTrack: React_2.ForwardRefExoticComponent<VideoTrackProps & React_2.RefAttributes<HTMLVideoElement>>;

// @public (undocumented)
export interface VideoTrackProps extends React_2.VideoHTMLAttributes<HTMLVideoElement> {
Expand Down
6 changes: 0 additions & 6 deletions packages/react/src/components/controls/TrackToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ import * as React from 'react';
import { getSourceIcon } from '../../assets/icons/util';
import { useTrackToggle } from '../../hooks';

declare module 'react' {
function forwardRef<T, P = object>(
render: (props: P, ref: React.Ref<T>) => React.ReactElement | null,
): (props: P & React.RefAttributes<T>) => React.ReactElement | null;
}

/** @public */
export interface TrackToggleProps<T extends ToggleSource>
extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {
Expand Down

0 comments on commit c2ad1ae

Please sign in to comment.