I am trying to use kotlin-react-router-dom, but ge...
# react
e
I am trying to use kotlin-react-router-dom, but getting browser error Error: Cannot find module 'kotlin-react-router-dom' build.gradle.kts
implementation(npm("react-router-dom", "4.3.1"))
implementation(npm("@jetbrains/kotlin-react-router-dom", "4.3.1-pre.91"))
It builds but gets the error when I run. Noticed that build/js/node_modules does not have kotlin-react-router-dom I have a sample project at: https://github.com/eloew/KotlinReactRoute
c
you need to add the npm dependency
Copy code
implementation(npm("react-router", "5.1.2"))
oh it seems you are missing this instead:
Copy code
implementation("org.jetbrains:kotlin-react-router-dom:5.1.2$kotlinWrappersVersion")
btw you have pretty old dependencies
e
This worked! Thanks for the help. I'll update my versions also.
t
In latest wrapper version you don’t need declare npm dependencies (like
react
,
react-dom
,
react-router-dom
, only wrapper declaration required.
👍 1
c
is that also true for
kotlin-styled
?
t
Yes
It is true for all wrappers from
kotlin-wrappers
cc @Sebastian Aigner
👌🏻 1
s
Can confirm that it does work for any wrapper from
kotlin-wrappers
👍 1