We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15e932b commit c210297Copy full SHA for c210297
nightwatch/commands/mountReactComponent.js
@@ -240,10 +240,13 @@ module.exports = class Command {
240
}
241
242
static _getReactImports() {
243
+ const { version } = require(path.resolve('node_modules', 'react'));
244
+ const reactDOMSuffix = version.startsWith('18') ? '/client': '';
245
+
246
return `
- import '/node_modules/react/umd/react.development.js';
- import '/node_modules/react-dom/umd/react-dom.development.js';
- `;
247
+ import * as React from 'react';
248
+ import * as ReactDOM from "react-dom${reactDOMSuffix}";
249
+ `;
250
251
252
/**
0 commit comments