HI i simply need to go to link which i provide (le...
# javascript
d
HI i simply need to go to link which i provide (lets say /articles/myfavarticle). I am using hash router (reac-dom-router). So when i click on button element i want to redirect to that page. How should i do this ?
😶 1
1
Someone correctly marked is as not kotlin though im writing in kotlin using react-dom-router library. Anyway..
Copy code
div(classes = "w3-col m8 s12") {
    p {
        child(LinkComponent::class) {
            <http://attrs.to|attrs.to> = "article/${props.article.name}"
            button(classes = "w3-button w3-padding-large w3-white w3-border") {
                b {
                    +"${props.readMore}»"

                }
            }
        }
LinkComponent is basically solution for my problem. There is a good page on routing using react-dom-router https://dev.to/ebraimcarvalho/a-simple-way-to-redirect-react-router-dom-5hnn and https://dev.to/projectescape/programmatic-navigation-in-react-3p1l