Skip to content

Commit e6dfda5

Browse files
authored
fix: merge circular dependency (#1964)
* fix: merge circular dependency * chore: remove tsconfig.tsbuildinfo * chore: update .gitignore
1 parent 6c3a830 commit e6dfda5

File tree

5 files changed

+11
-22
lines changed

5 files changed

+11
-22
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ yarn-error.log
1111
.vscode/
1212
/disttest/
1313
/dist/
14+
tsconfig.tsbuildinfo

package-lock.json

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
"@mux/mux-player-react": "^3.5.1",
5454
"cloudflare-video-element": "^1.3.3",
5555
"dash-video-element": "^0.1.6",
56-
"deepmerge": "^4.0.0",
5756
"hls-video-element": "^1.5.6",
5857
"spotify-audio-element": "^1.0.2",
5958
"tiktok-video-element": "^0.1.0",

src/ReactPlayer.tsx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { lazy, Suspense, useEffect, useState } from 'react';
2-
import merge from 'deepmerge';
32

43
import { defaultProps } from './props.js';
54
import Player from './Player.js';
@@ -33,8 +32,8 @@ export const createReactPlayer = (players: PlayerEntry[], playerFallback: Player
3332
return null;
3433
};
3534

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

3938
const { src, slot, className, style, width, height, fallback, wrapper } = props;
4039
const [showPreview, setShowPreview] = useState(!!props.light);
@@ -83,19 +82,19 @@ export const createReactPlayer = (players: PlayerEntry[], playerFallback: Player
8382
activePlayer={player.player ?? (player as unknown as PlayerEntry['player'])}
8483
slot={wrapper ? undefined : slot}
8584
className={wrapper ? undefined : className}
86-
style={wrapper
87-
? { display: 'block', width: '100%', height: '100%' }
88-
: { display: 'block', width, height, ...style }}
85+
style={
86+
wrapper
87+
? { display: 'block', width: '100%', height: '100%' }
88+
: { display: 'block', width, height, ...style }
89+
}
8990
config={config}
90-
>{children}</Player>
91+
/>
9192
);
9293
};
9394

94-
const Wrapper: ReactPlayerProps['wrapper'] =
95-
wrapper == null ? ForwardChildren : wrapper;
95+
const Wrapper: ReactPlayerProps['wrapper'] = wrapper == null ? ForwardChildren : wrapper;
9696

97-
const UniversalSuspense =
98-
fallback === false ? ForwardChildren : Suspense;
97+
const UniversalSuspense = fallback === false ? ForwardChildren : Suspense;
9998

10099
return (
101100
<Wrapper slot={slot} className={className} style={{ width, height, ...style }}>

tsconfig.tsbuildinfo

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)