Has anyone ever loaded a dynamic image using requi...
# javascript
n
Has anyone ever loaded a dynamic image using require function like below? Mine throws Syntax error but works with static image.
Copy code
val imageUrl = kotlinext.js.require("./resources/images/${introSlides.image}")
The code below works.
Copy code
val imageUrl = kotlinext.js.require("./resources/images/logo.png")
t
You can avoid this problem if you will use
require
in inline functions only
👍 1