-
-
Notifications
You must be signed in to change notification settings - Fork 984
Closed
Description
I expected something like this
import { children, createMemo } from 'solid-js';
function ParentComponent(props) {
const c = children(() => props.children);
// Find a specific component by type
const specificChild = createMemo(() => {
return c().find(child => child.type === SpecificComponent);
});
return (
<div>
{c()}
{specificChild({...specificChild.props, item:1})}
</div>
);
}
but going up and down the internet couldn't find anything. This is very useful to be able to implement strategy pattern. Also I saw that Angular recently provided some helper functions to get info about a component or update its input.
this could help to generate different structure based on available children
Metadata
Metadata
Assignees
Labels
No labels