Closed caracal7 closed 5 years ago
@caracal7 If you want to say render child component from parent component
then here it is.
const { div, span, h3 } = H;
const appDiv = document.body;
const HeadingComponent = () => {
return div(
h3('.dom render child inside parent component'),
H(
MainComponent, { value: 'M' },
)
);
}
const SubComponent = (props, state, setState) => {
return div('Sub component props: ', span(`${props.value}`));
}
const MainComponent = (props, state, setState) => {
return div(
'Main component props: ', span(`${props.value}`),
H(
SubComponent, { value: 'S' }
)
);
}
R(
H(
HeadingComponent
),
appDiv
)
I hope you wanted this.
@rjoydip thanks for handling this 👍 @caracal7 I am going to close this, open it again if you still have issues.
How to use children inside custom components? Something something like
H( MyComponent, {prop: "value"}, H( 'child' ), MySubComponent)
& etc.