I am using the react wrapper provided by the creat...
# javascript
b
I am using the react wrapper provided by the create-react-kotlin-app script. I am trying to define the external library ReactMarkdown. I have made sure to add the dependencies to my package.json. I am receiving the following error
TypeError: Cannot read property '$metadata$' of undefined
. Here is my current declaration in a file named reactMarkdown.
Copy code
@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
Copy code
package reactMarkdown

import react.RBuilder

fun RBuilder.markdown(source: String) = child(ReactMarkdown::class) {
    attrs {
        this.source = source
    }
}
and in use
Copy code
div {
    markdown("# Header")
}
Am I defining the module incorrectly?