aaahah! When I changed it to @JsModule("react-sele...
# javascript
l
aaahah! When I changed it to @JsModule("react-select/dist/react-select.js"), the error is gone 😄 so maybe that's the proper way ...
n
The proper way is to use the @JsName annotation to identify the member of the JS module that the external Kotlin declaration defines
b
Looks like your module system can’t resolve “react-select”. Why is it in
dist
dir but not in
node_modules
?
n
It is.
Does Kotlin JS handle default exports from native modules?
Maybe you need to add
@JsName(“default”)
to get the default export
b
Kotlin/JS can’t guess is it default import or isn’t, so you need annotate it explicitly
Yes
@JsName("default")
should help, right declaration should looks like:
Copy code
@file:JsModule("react-select")

@JsName("default")
external val Select: RClass<dynamic>
Thanks, @natpryce