-
Notifications
You must be signed in to change notification settings - Fork 164
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
How to pass a child function to a component #130
Comments
Use
|
This doesn't change the problem. I don't want to add a component child to the |
Here's example how to add functional component in terms of kotlin react #121 |
Not applicable. |
This works: fun <P> RBuilder.renderChild(rc: RBuilder.(P) -> Unit) {
childList += { p: P -> buildElement { rc(p) } }
} And can be used as such: Transition {
attrs {
`in` = shown
timeout = 350
}
renderChild { transitionState: String ->
div { /*...*/ }
}
} This should be added to the library. |
|
I'm trying to use an external component that I have imported as such:
This component expects a function child (see its doc here: http://reactcommunity.org/react-transition-group/transition).
So, I can use it, but how do I give it a child function?
I've tried
childList += { trState: String -> ... }
but this yields a React error: "Invariant Violation: Objects are not valid as a React child (found: object with keys {}). If you meant to render a collection of children, use an array instead."The text was updated successfully, but these errors were encountered: