Closed mike-thompson-day8 closed 9 years ago
Thanks! I updated the recipes to use :component-function instead of :render.
Thanks!
I'm really sorry about this, but I've given you bad advice here.
After Dan gave his blessing for ongoing use of :component-function
there was much negative comment about the name, and so Dan has instead chosen :reagent-render
.
So now we're faced with:
:component-function
(in theory this was never a part of the official API):reagent-render
(officially a part of the API)Maybe the cookbook examples should return to using straight :render
until after 0.5.0 is released? Promoting :reagent-render
is a good idea, but not until it is official.
Sorry again.
Oh, no need to be sorry! I wasn't even aware of :component-function
to begin with, so I am glad you brought it up. I agree about promoting it once it is renamed to :reagent-render
and official in the next reagent release. Until then, I converted everything back to :render
.
Now that reagent 0.5.0 is out, I updated the recipes to use :reagent-render
I believe it is a mistake to be promoting the use of
:render
when callingreagent/create-class
For example, I believe this is a mistake:
A renderer function supplied via
:render
will only ever be called with one parameter (this
) which is a pain when you are writing components which need to take multiple parameters (about 99% of them). Newbies are constantly surprised about not getting their parameters passed intorender
. I've found myself answering the question steadily over the last year.The alternative is to use
:component-function
instead of:render
. My write upDan's Blessing