This technique is a great way to write declarative APIs for code based APIs. Ember Leaflet does this.
-
-
-
React people call this kind of thing "higher order components"
-
Just watched this video and it seems this technic is actually called render propshttps://twitter.com/kentcdodds/status/911086452699627522 …
-
No, those are two different things.
-
Well I guess your right in regards to tagName: '' but I'm talking more about the use of that to build declarative apis with {{yield}}
-
I've completely lost this thread at this point...
-
Watched! "Render prop" is synonymous with "Block Param" in Ember: <Mouse>{mouse => ...}</Mouse> {{
#my-mouse as |mouse|}}...{{/my-mouse}} -
And with the upcoming angle bracket syntax in Ember: <Mouse as |mouse|>...</Mouse>
- 3 more replies
New conversation -
-
-
I did. Always wondered why it’s not ‘tagName: null’.
-
Stupid reason. `null` was originally the default value of tagName, and the code checks for null to assign to 'div'
-
As a result, null became a public API for "the default". This all goes away with Glimmer components, so no need to break compat now.
End of conversation
New conversation -
-
-
When I heard of this 2 years ago, it was possible but not recommended.
-
It's totally fine. Just don't try to use this.element (you'll get an error and cuz it doesn't make sense)
-
Or any of the event handlers ;)
End of conversation
New conversation -
-
-
That’s been around for ages hasn’t it?
-
Yep. I think before 1.0.
-
Ok. Assume you are mentioning it because you are seeing too many unnecessary <div /> tags in Ember apps?
End of conversation
New conversation -
-
-
but I don’t think it works if you pass null. 
-
Yeah, for a stupid reason.https://twitter.com/wycats/status/911615428027404288 …
-
Ahh makes sense. Well here’s to glimmer! Onwards and upwards
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.