Skip to content
This repository has been archived by the owner on Oct 19, 2018. It is now read-only.

support functions as children #250

Open
catmando opened this issue Feb 19, 2018 · 0 comments
Open

support functions as children #250

catmando opened this issue Feb 19, 2018 · 0 comments
Milestone

Comments

@catmando
Copy link
Contributor

currently you cannot say this:

Foo do
  lambda (x) { DIV { x } }
end

even though its legal JS... i.e. we only allow strings or other components. We should also allow functions, but we probably make render operate on procs to make it work properly...

Foo do
  (lambda (x) { DIV { x } }).render
end

see https://medium.com/merrickchristensen/function-as-child-components-5f3920a9ace9 for more info... but don't be too confused... `children` in React, strangely enough, returns either an element or an array.  i.e. if there is only one child, then children is that child, but if there multiple...  It just makes these examples confusing.  Woah its madness... see https://mxstbr.blog/2017/02/react-children-deepdive/
@catmando catmando added this to the Release 0.15 milestone Feb 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant