2

I try to reference an image resource from react kotlin app.

welcome.kt under src/main/kotlin:

import react.dom.img

@JsModule("./logo.svg")
@JsNonModule
external val logo: dynamic

@JsExport
class Welcome : RComponent<RProps, RState>() {

    override fun RBuilder.render() {
        img {
            attrs {
                src = logo
            }
        }
    }
}

logo.svg was saved under src/main/resources

Building application ends in

Module './logo.svg' not found

Application was created with "React Application" template in IntelliJ Idea 2020.3.2

Thanks in advance.

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.