preact-custom-element icon indicating copy to clipboard operation
preact-custom-element copied to clipboard

Provide light dom props children

Open paull39 opened this issue 1 year ago • 6 comments

This commit provides a resolution for issue #41, applying a strategy similar to the one used in pull request #56. The commit ensures that the children of a component, such as 'FooComponent', are correctly rendered even without using the Shadow DOM.

An example component which should render now correct in the not shadow-dom:

function FooComponent(props) {
    return (
        <Fragment>
            <h1>My Heading</h1>
            {/* Render the children inside this div */}
            <div>{props.children}</div>
        </Fragment>
    );
}

paull39 avatar May 10 '23 17:05 paull39