fix(ct): react17 primitive as slot (#21396)

This commit is contained in:
Sander 2023-03-06 17:59:35 +01:00 committed by GitHub
parent 872b8ddbdd
commit 99e736afc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -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();
/**

View File

@ -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.