jwplayer-video-element
Advanced tools
Comparing version 1.1.4 to 1.1.5
// This file is generated by media-elements/scripts/build-react-wrapper! | ||
'use client'; | ||
import React, { useRef, useEffect } from 'react'; | ||
import React from 'react'; | ||
import Element from '../jwplayer-video-element.js'; | ||
@@ -9,3 +9,3 @@ | ||
let { children, suppressHydrationWarning, ...props } = allProps; | ||
ref ??= useRef(); | ||
const elementRef = React.useRef(null); | ||
@@ -18,4 +18,4 @@ for (let name in props) { | ||
useEffect(() => { | ||
const eventTarget = ref?.current; | ||
React.useEffect(() => { | ||
const eventTarget = elementRef?.current; | ||
if (!eventTarget || typeof callback !== 'function') return; | ||
@@ -28,3 +28,3 @@ | ||
}; | ||
}, [ref?.current, callback]); | ||
}, [elementRef?.current, callback]); | ||
} | ||
@@ -53,3 +53,13 @@ } | ||
...attrs, | ||
ref, | ||
ref: React.useCallback( | ||
(node) => { | ||
elementRef.current = node; | ||
if (typeof ref === 'function') { | ||
ref(node); | ||
} else if (ref !== null) { | ||
ref.current = node; | ||
} | ||
}, | ||
[ref] | ||
), | ||
children, | ||
@@ -56,0 +66,0 @@ suppressHydrationWarning, |
{ | ||
"name": "jwplayer-video-element", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "A custom element for the JW player with an API that matches the `<video>` API", | ||
@@ -36,3 +36,3 @@ "author": "@muxinc", | ||
"devDependencies": { | ||
"build-react-wrapper": "^0.1.4", | ||
"build-react-wrapper": "^0.1.5", | ||
"npm-run-all": "^4.1.5", | ||
@@ -39,0 +39,0 @@ "wet-run": "^1.2.2" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11564
198