@vnejs/plugins.media.video 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/view/index.jsx +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/plugins.media.video",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
package/view/index.jsx CHANGED
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
2
- import ReactDOM from "react-dom";
2
+ import { createRoot } from "react-dom/client";
3
3
 
4
4
  import { cn } from "@bem-react/classname";
5
5
 
@@ -10,7 +10,7 @@ import "./index.styl";
10
10
  const b = cn("VideoView");
11
11
 
12
12
  const VideoView = ({ store, onMount, ...props } = {}) => {
13
- const [{ isShow = false, isForce = false, src = "" }, setState] = useState({});
13
+ const [{ isShow = false, isForce = false, src }, setState] = useState({});
14
14
 
15
15
  useEffect(() => store.subscribe(setState), []);
16
16
  useEffect(() => void onMount(), []);
@@ -45,4 +45,4 @@ const VideoView = ({ store, onMount, ...props } = {}) => {
45
45
  );
46
46
  };
47
47
 
48
- export const render = (props, root) => ReactDOM.render(<VideoView {...props} />, root);
48
+ export const render = (props, root) => createRoot(root).render(<VideoView {...props} />);