-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use children as default prop for rt-template #120
Comments
It seems logical, anyway I don't understand when you say
|
I mean, then i can either define children <MyComp>
<div>
</div>
</MyComp> or a <MyComp>
<rt-template>
</rt-template>
</MyComp> but not both at the same time. |
can you provide an actual example? I've just tried it in the playground and it seems to work. |
This is working for me: myart.rt: <div>
title = {this.props.title()}
body = {this.props.children}
</div> myapp.rt: <MyArt>
<rt-template prop="title"><div>this goes into title</div></rt-template>
<div>this goes into children</div>
</MyArt> |
It is? Didn't know that. Then cross the line you quoted from me out. But still, making |
the only issue I see in making it default is that it would require This because Note that this issue makes I am going to address it with a different syntax, see #104 |
Currently this is working
whereas
prop="..."
is mandatory. Wouldn't it make sense, to allow omittingprop
and, when omitted, just to assumeprop="children"
as default? This would match with the common React pattern, to pass a function as children that generates the inner content to render dynamically. Or even completely remove theprop="..."
and always usechildren
for that (since we cannot havert-template
and additionalchildren
at the same time anyway).This would then look like this:
The text was updated successfully, but these errors were encountered: