Skip to content

Commit fca0bdb

Browse files
xkelxmcluwes
andcommitted
fix: prevent infinite recursion in deepmerge by extracting children prop (#1933)
* Fix: prevent infinite recursion in deepmerge by extracting children prop - Updated ReactPlayer to destructure and exclude children from props before merging with defaultProps. - This prevents deepmerge from causing infinite recursion when children are present. - Children are now explicitly passed to the underlying player component, enabling custom content without recursion issues. * Update src/ReactPlayer.tsx --------- Co-authored-by: Wesley Luyten <[email protected]>
1 parent aba61fa commit fca0bdb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ReactPlayer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const createReactPlayer = (players: PlayerEntry[], playerFallback: Player
3333
return null;
3434
};
3535

36-
const ReactPlayer: ReactPlayer = React.forwardRef((_props, ref) => {
36+
const ReactPlayer: ReactPlayer = React.forwardRef(({ children, ..._props } , ref) => {
3737
const props = merge(defaultProps, _props);
3838

3939
const { src, slot, className, style, width, height, fallback, wrapper } = props;
@@ -87,7 +87,7 @@ export const createReactPlayer = (players: PlayerEntry[], playerFallback: Player
8787
? { display: 'block', width: '100%', height: '100%' }
8888
: { display: 'block', width, height, ...style }}
8989
config={config}
90-
/>
90+
>{children}</Player>
9191
);
9292
};
9393

0 commit comments

Comments
 (0)