Daniele B
09/22/2020, 12:50 PMrouteLink
, I want to change the url when I am clicking on a td
element, what code should I use?spand
09/22/2020, 12:57 PMtd.attrs.onClick { e -> history.push(url) }
You can get the history from RouteResult and pass it down or maybe use something like withRouter
but havent used it myselfDaniele B
09/22/2020, 1:09 PMDaniele B
09/22/2020, 1:09 PMDaniele B
09/22/2020, 3:09 PMonClickFunction = { window.history.pushState(null, "", "/country/${props.item.encodedName}") }
the url gets updated on the browser, but the browerRouter is not picking up the changeDaniele B
09/22/2020, 3:46 PMval history = useHistory()
......
tr.attrs {
onClickFunction = { history.push("/country/${props.item.encodedName}") }
}
Daniel Buřval
11/05/2021, 10:49 AM