mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
fix(ct): react17 primitive as slot (#21396)
This commit is contained in:
parent
872b8ddbdd
commit
99e736afc8
@ -25,7 +25,7 @@ import { createRoot } from 'react-dom/client';
|
||||
|
||||
/** @type {Map<string, FrameworkComponent>} */
|
||||
const registry = new Map();
|
||||
/** @type {Map<Element, import('react-dom/client').Root>>} */
|
||||
/** @type {Map<Element, import('react-dom/client').Root>} */
|
||||
const rootRegistry = new Map();
|
||||
|
||||
/**
|
||||
|
@ -36,9 +36,11 @@ export function register(components) {
|
||||
|
||||
/**
|
||||
* @param {Component} component
|
||||
* @returns {JSX.Element}
|
||||
*/
|
||||
function render(component) {
|
||||
if (typeof component !== 'object' || Array.isArray(component))
|
||||
return component;
|
||||
|
||||
let componentFunc = registry.get(component.type);
|
||||
if (!componentFunc) {
|
||||
// Lookup by shorthand.
|
||||
|
Loading…
x
Reference in New Issue
Block a user