Hi,
I've switched from React to Mithril, and MSX has been really great. With JSX, you can invoke {this.props.children} to render child components that can be between an opening and closing tag.
<MyComponent>
<MyHeader>{this.props.heading}</MyHeader>
<SomeContent>
<AnotherCustomComponent/>
<AnotherComponent>
<ReallyNestedNow/>
</AnotherComponent>
</SomeContent>
</MyComponent>
So how does it work?
SomeContent () {
render () {
<div>
<header>
<h4>Lorem Ipsum</h4>
</header>
{this.props.children}
// In this example, it would render every component inbetween the opening and closing <SomeContent> tag as seen above.
<footer>Lalalalalal</footer>
</div>
}
}
This makes working with JSX very easy, especially when running into situations where it makes more sense to enclose a component this way.
I'm running into a sitaution with Mithril where I want to do this, but it is not working. Is there any alternative?
Thanks!!
Matt