File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 2727 "eslint-plugin-react" : " ^7.20.3" ,
2828 "eslint-plugin-react-hooks" : " ^4.0.5" ,
2929 "md-insert" : " ^1.0.1" ,
30- "min-react-env" : " ^1 .0.1 " ,
30+ "min-react-env" : " ^2 .0.0 " ,
3131 "prop-types-table" : " ^1.0.0" ,
3232 "react" : " ^18.0.0" ,
3333 "react-dom" : " ^18.0.0" ,
Original file line number Diff line number Diff line change 33 * https://github.com/troybetz/react-youtube
44 */
55
6+ /* global document */
7+
68import React from 'react' ;
79import ReactDOM from 'react-dom' ;
810import { act } from 'react-dom/test-utils' ;
9- import env from 'min-react-env' ;
11+ import 'min-react-env/install ' ;
1012import createYouTube from './createYouTube' ;
1113
12- Object . assign ( global , env ) ;
14+ const reactMajor = parseInt ( ( ReactDOM . version || '16' ) . split ( '.' ) [ 0 ] , 10 ) ;
1315
1416async function render ( initialProps ) {
1517 const { YouTube, sdkMock, playerMock } = createYouTube ( ) ;
@@ -44,9 +46,9 @@ async function render(initialProps) {
4446 }
4547 }
4648
47- const div = env . document . createElement ( 'div' ) ;
49+ const div = document . createElement ( 'div' ) ;
4850 let root ;
49- if ( ReactDOM . version . startsWith ( '18' ) || ReactDOM . version . startsWith ( '19' ) ) {
51+ if ( reactMajor >= 18 ) {
5052 const { createRoot } = await import ( 'react-dom/client' ) ;
5153 root = createRoot ( div ) ;
5254 } else {
You can’t perform that action at this time.
0 commit comments