Another question regarding integration of existing...
# javascript
a
Another question regarding integration of existing JS libraries. Maybe some KotlinJS super hero can help me out? The component I need to integrate has a component field as part of its props. "Object containing header, footer, body and container components" { Header react.ElementType Footer react.ElementType Body react.ElementType Container react.ElementType } In my Kotlin code, so far I've got this:
Copy code
data class ModalComponents(
    var Header: dynamic = undefined,
    var Footer: dynamic = undefined,
    var Body: dynamic = undefined,
    var Container: dynamic = undefined
)
And I use it like this:
Copy code
attrs.components = ModalComponents(
                                Footer = MyFooterComponent()
                            )
This leads to the following error message: "Uncaught Invariant Violation: ModalFooter(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null." In the original JS code, I can see that MyFooterComponent will be used like this within render:
Copy code
return createElement(component, {
          appearance: appearance,
          onClose: onClose,
          showKeyline: showKeyline
        });
So instead of Footer = MyFooterComponent(), I need to pass it something that is acceptible as the first parameter of createElement, but I have no clue what that would need to be ...