4.3.1-pre.91 • Published 4 years ago

@jetbrains/kotlin-react-router-dom v4.3.1-pre.91

Weekly downloads
53
License
Apache-2-0
Repository
github
Last release
4 years ago

kotlin-react-dom

Kotlin wrapper for React Router DOM library. Major version number of this wrapper matches that of React Router DOM itself.

Both BrowserRouter and HashRouter are supported.

Installation

  1. npm i @jetbrains/kotlin-react-router-dom

  2. npm run gen-idea-libs

See the Bintray page for Maven and Gradle installation instructions.

Examples

interface IdProps : RProps {
    var id: Int
}

class RootComponent : RComponent<RProps, RState>() {
    override fun RBuilder.render() {
        hashRouter { // or "browserRouter"
            switch {
                route("/", IndexComponent::class, exact = true)
                route("/login", strict = true) {
                    login(providers = listOf("plain", "facebook"))
                    a(href = "#/") {
                        +"Back"
                    }
                }
                route<IdProps>("/user/:id") { props ->
                    div {
                        +"User id: ${props.match.params.id}"
                    }
                }
                redirect(from = "/redirect", to = "/redirected")
            }
        }
    }
}

Tutorial

See lawik123/kotlin-poc-frontend-react-redux. This project is an implementation/translation of the react-redux Todo List example project in Kotlin (with the addition of react-router).

4.3.1-pre.91

4 years ago

4.3.1-pre.89

4 years ago

4.3.1-pre.83

5 years ago

4.3.1-pre.82

5 years ago

4.3.1-pre.80

5 years ago

4.3.1-pre.67

5 years ago

4.3.1-pre.61

5 years ago

4.3.1-pre.60

5 years ago

4.3.1-pre.58

6 years ago

4.3.1-pre.56

6 years ago

4.3.1-pre.55

6 years ago

4.3.1-pre.54

6 years ago

4.3.1-pre.53

6 years ago

4.3.1-pre.52

6 years ago

4.3.1-pre.49

6 years ago

4.3.1-pre.48

6 years ago

4.3.1-pre.47

6 years ago

4.3.1-pre.46

6 years ago

4.3.1-pre.38

6 years ago

4.3.1-pre.37

6 years ago

4.2.2-pre.31

6 years ago

4.2.2-pre.30

6 years ago

4.2.2-pre.28

6 years ago

4.2.2-pre.27

6 years ago

4.2.2-pre.26

6 years ago

4.2.2-pre.25

6 years ago

4.2.2-pre.23

6 years ago

4.2.2-pre.22

6 years ago

4.2.2-pre.21

6 years ago

4.2.2-pre.20

6 years ago

4.2.2-pre.19

6 years ago

4.2.2-pre.18

6 years ago