Skip to content

Commit b58d1a6

Browse files
committed
fix(player): resolve internal type errors
1 parent fc86c72 commit b58d1a6

9 files changed

Lines changed: 3059 additions & 1104 deletions

File tree

packages/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"media-icons": "^1.1.5",
5050
"react": "^19.0.0",
5151
"react-dom": "^19.0.0",
52-
"remotion": "^4.0.193",
52+
"remotion": "4.0.193",
5353
"rimraf": "^3.0.2",
5454
"rollup": "^4.20.0",
5555
"rollup-plugin-dts": "^6.1.1",

packages/react/src/components/layouts/default/ui/time.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { DefaultLiveButton } from './buttons';
1111

1212
interface DefaultTimeGroupSlots {
1313
currentTime?: React.ReactNode;
14-
timeSeparator?: React.ReactNode;
14+
timeDivider?: React.ReactNode;
1515
endTime?: React.ReactNode;
1616
}
1717

packages/react/src/components/primitives/slot.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* -----------------------------------------------------------------------------------------------*/
44

55
import * as React from 'react';
6+
67
import { composeRefs } from 'maverick.js/react';
78

89
/* -------------------------------------------------------------------------------------------------
@@ -20,15 +21,15 @@ const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {
2021

2122
if (slottable) {
2223
// the new element to render is the one passed as a child of `Slottable`
23-
const newElement = slottable.props.children as React.ReactNode;
24+
const newElement = (slottable.props as { children: React.ReactNode }).children;
2425

2526
const newChildren = childrenArray.map((child) => {
2627
if (child === slottable) {
2728
// because the new element will be the one rendered, we are only interested
2829
// in grabbing its children (`newElement.props.children`)
2930
if (React.Children.count(newElement) > 1) return React.Children.only(null);
3031
return React.isValidElement(newElement)
31-
? (newElement.props.children as React.ReactNode)
32+
? (newElement.props as { children: React.ReactNode }).children
3233
: null;
3334
} else {
3435
return child;
@@ -66,7 +67,7 @@ const SlotClone = React.forwardRef<any, SlotCloneProps>((props, forwardedRef) =>
6667

6768
if (React.isValidElement(children)) {
6869
return React.cloneElement<any>(children, {
69-
...mergeProps(slotProps, children.props),
70+
...mergeProps(slotProps, children.props as any),
7071
ref: forwardedRef ? composeRefs(forwardedRef, (children as any).ref) : (children as any).ref,
7172
});
7273
}

packages/react/src/components/ui/poster.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ const Poster = React.forwardRef<HTMLImageElement, PosterProps>(
4141
({ children, ...props }, forwardRef) => {
4242
return (
4343
<PosterBridge
44-
src={props.asChild && React.isValidElement(children) ? children.props.src : undefined}
44+
src={
45+
props.asChild && React.isValidElement(children)
46+
? (children.props as React.ComponentProps<'img'>).src
47+
: undefined
48+
}
4549
{...(props as Omit<PosterProps, 'ref'>)}
4650
>
4751
{(props, instance) => (
@@ -85,7 +89,7 @@ const PosterImg = React.forwardRef<HTMLImageElement, PosterImgProps>(
8589
src={$src || undefined}
8690
alt={$alt || undefined}
8791
crossOrigin={$crossOrigin || undefined}
88-
ref={composeRefs(img.set as React.Ref<HTMLImageElement>, forwardRef)}
92+
ref={composeRefs(img.set as any, forwardRef)}
8993
style={{ display: $hidden ? 'none' : undefined }}
9094
>
9195
{children}

packages/react/src/components/ui/sliders/time-slider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ interface ChapterTracksProps {
143143
function ChapterTracks({ instance, children }: ChapterTracksProps) {
144144
const $cues = useSignal(() => instance.cues, instance),
145145
refs = React.useRef<HTMLElement[]>([]),
146-
emptyCue = React.useRef<VTTCue>(),
146+
emptyCue = React.useRef<VTTCue>(null!),
147147
{ $chapters } = React.useContext(TimeSliderContext);
148148

149149
if (!emptyCue.current) {
@@ -365,7 +365,7 @@ const VideoProvider = React.forwardRef<HTMLVideoElement, VideoProviderProps>(
365365
playsInline
366366
preload={$canLoad ? 'auto' : 'none'}
367367
crossOrigin={$crossOrigin || undefined}
368-
ref={composeRefs(video.set as React.Ref<HTMLVideoElement>, forwardRef)}
368+
ref={composeRefs(video.set as any, forwardRef)}
369369
>
370370
{children}
371371
</Primitive.video>

packages/react/src/hooks/use-media-remote.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function useMediaRemote(
1818
target?: EventTarget | null | React.RefObject<EventTarget | null>,
1919
): MediaRemoteControl {
2020
const media = useMediaContext(),
21-
remote = React.useRef<MediaRemoteControl>();
21+
remote = React.useRef<MediaRemoteControl>(null!);
2222

2323
if (!remote.current) {
2424
remote.current = new MediaRemoteControl();

packages/react/src/providers/remotion/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type * as React from 'react';
22

33
export interface RemotionSrc<InputProps extends RemotionInputProps = RemotionInputProps> {
44
/** React component which is generally a Remotion video. */
5-
src: React.ComponentType;
5+
src: React.ComponentType<unknown>;
66
/** Remotion source type. */
77
type: 'video/remotion';
88
/**

0 commit comments

Comments
 (0)