Combine Kotlin an jsx files

Hy,

i have created a Project like this article, https://kotlinlang.org/docs/multiplatform-full-stack-app.html#set-up-the-frontend

If i started this, then all would be good and all is running. Now i need to implement js file like these Structure:

export default function Car() {
...
    return (
        <Box>...</Box>
    );
}

Then i write an adapter for this, to implement in kotlin:
@JsModule(“./Car”)
@JsNonModule
external val Car : FC< BoxProps>

Now the problem is, i get an error like that:

Can anyone help me please about that? Thank you.

Br
Mike

Where did you see JSX being used with Kotlin? I’ve never heard of anyone using JSX (or would it be called “KX” since it’s Kotlin instead of Javascript) with Kotlin myself.

Usually, it’s an HTML DSL like in the documentation you linked.

Even when making a React app with Kotlin you still use HTML builders

div {
    css {
        position = Position.absolute
        top = 10.px
        right = 10.px
    }
    h3 {
        +"John Doe: Building and breaking things"
    }
    img {
        src = "https://via.placeholder.com/640x360.png?text=Video+Player+Placeholder"
    }
}

Hy,

thanks. Kotlin create JS-Files with Webpack. I need to use also external JS-Files and not only with HTML-Builders.

Br
Mike