bkenn
01/25/2018, 2:41 AMTypeError: Cannot read property '$metadata$' of undefined. Here is my current declaration in a file named reactMarkdown.
@file:JsModule("react-markdown")
package reactMarkdown
import react.RProps
import react.RState
import react.React
import react.ReactElement
@JsName("ReactMarkdown")
external class ReactMarkdown: React.Component<ReactMarkdownProps, RState> {
override fun render(): ReactElement?
}
external interface ReactMarkdownProps: RProps {
var source: String
}
Here is the dsl in a file called reactMarkdownDsl
package reactMarkdown
import react.RBuilder
fun RBuilder.markdown(source: String) = child(ReactMarkdown::class) {
attrs {
this.source = source
}
}
and in use
div {
markdown("# Header")
}
Am I defining the module incorrectly?