move comment
This commit is contained in:
parent
26cbeb5492
commit
46e06736a8
|
|
@ -33,6 +33,7 @@ function isJsxComponent(component) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Turns the Playwright representation of JSX (see jsx-runtime.js) into React.createElement calls.
|
||||||
* @param {any} value
|
* @param {any} value
|
||||||
*/
|
*/
|
||||||
function __pwRender(value) {
|
function __pwRender(value) {
|
||||||
|
|
@ -40,7 +41,7 @@ function __pwRender(value) {
|
||||||
if (isJsxComponent(v)) {
|
if (isJsxComponent(v)) {
|
||||||
const component = v;
|
const component = v;
|
||||||
let type = component.type;
|
let type = component.type;
|
||||||
if (type && type.__pw_jsx_fragment) // detects the playwright mock Fragment (see jsx-runtime.js), used in <></> notation
|
if (type && type.__pw_jsx_fragment)
|
||||||
type = __pwReact.Fragment;
|
type = __pwReact.Fragment;
|
||||||
const props = component.props ? __pwRender(component.props) : {};
|
const props = component.props ? __pwRender(component.props) : {};
|
||||||
const key = component.key ? __pwRender(component.key) : undefined;
|
const key = component.key ? __pwRender(component.key) : undefined;
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ function jsxs(type, props, key) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this is used in <></> notation
|
||||||
const Fragment = { __pw_jsx_fragment: true };
|
const Fragment = { __pw_jsx_fragment: true };
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue