https://kotlinlang.org logo
Title
j

Jansen Ferreira

03/14/2023, 10:09 PM
Can you help me with kotlin app?
k

Kirill Grouchnikov

03/14/2023, 10:12 PM
Do you have any specific questions?
j

Jansen Ferreira

03/14/2023, 10:12 PM
I was trying to create a KMP, but I still don't have enough experience in kotlin. So, I tried to create a kotlin-react app, but I got stuck on the part of rendering components according to their routes. So I'm trying the alternative of creating a Desktop app
I'm web developer. I started in the world of programming 9 months ago with web development. I learned react. now i'm trying to learn kotlin.
k

Kirill Grouchnikov

03/14/2023, 10:14 PM
#react might be a good place to ask specific questions
j

Jansen Ferreira

03/14/2023, 10:15 PM
But i'm trying to create a desktop kotlin app
k

Kirill Grouchnikov

03/14/2023, 10:19 PM
http://sscce.org/ is a good place overall to start as far as how to ask questions that have the best chance of getting concrete answers. The more focused and specific your question is, the shorter your sample code is, the more complete your description is, the better the chance is that somebody will take a look and answer. Something vague along the lines “it’s just not working”, or huge code dumps of hundreds of lines with all sorts of internal dependencies - that’s when you start losing people in these forums.
j

Jansen Ferreira

03/14/2023, 11:49 PM
You are right. I'm sorry for the bad question.
I would like to render components according to route in kotlin-react. I am getting the error: "Unresolved references" to exact, path and element on Route To solve that I tried this: install react-router-dom npm i react-router-dom in my component i try to use Route: import react.* import react.dom.* import react.router.dom.* import kotlin.browser.* import kotlinx.browser.document fun main() { render(document.getElementById("root")) { BrowserRouter { div { Route(exact = true, path = "/", render = { Home() }) Route(path = "/about", render = { About() }) } } } } fun RBuilder.Home() = div { h1 { +"Home" } p { +"Welcome to the homepage." } } fun RBuilder.About() = div { h1 { +"About" } p { +"This is the about page." } } in build.gradle.kts i try to import packages to use react-dom: val jsMain by getting { dependencies { implementation("org.jetbrains.kotlin-wrappers:kotlin-react:18.2.0-pre.346") implementation("org.jetbrains.kotlin-wrappers:kotlin-react-dom:18.2.0-pre.346") implementation("org.jetbrains.kotlin-wrappers:kotlin-emotion:11.9.3-pre.346") } } But still it is giving the above error.