Spheniscine
04/28/2022, 7:49 AMBig Chungus
04/28/2022, 8:11 AMhfhbd
04/28/2022, 8:18 AMSpheniscine
04/28/2022, 8:32 AMhfhbd
04/28/2022, 8:33 AMval router = Router.current
in your composable and use router.navigate(to="/foo")
everywhere.hfhbd
04/28/2022, 8:34 AMSpheniscine
04/28/2022, 11:46 AMSpheniscine
04/28/2022, 11:50 AMhfhbd
04/28/2022, 12:00 PMSpheniscine
04/28/2022, 12:19 PMSpheniscine
04/28/2022, 12:20 PMSpheniscine
04/28/2022, 12:20 PMhfhbd
04/28/2022, 12:20 PMhfhbd
04/28/2022, 12:21 PMSpheniscine
04/28/2022, 12:29 PMSpheniscine
04/28/2022, 12:29 PMhfhbd
04/28/2022, 12:40 PMSpheniscine
04/28/2022, 12:44 PMBig Chungus
04/28/2022, 12:45 PMhfhbd
04/28/2022, 12:45 PMhref
tag, I don’t.Spheniscine
04/28/2022, 12:46 PMhfhbd
04/28/2022, 12:47 PMevent.preventDefault()
Spheniscine
04/28/2022, 12:48 PMBig Chungus
04/28/2022, 12:49 PMhfhbd
04/28/2022, 12:50 PM@Composable
public fun NavLink(
to: String,
attrs: (AttrsScope<HTMLAnchorElement>.() -> Unit)? = null,
content: @Composable () -> Unit
) {
val router = Router.current
A(
href = to,
attrs = {
attrs?.invoke(this)
onClick {
router.navigate(to)
it.preventDefault()
}
}
) { content() }
}
Spheniscine
04/28/2022, 12:54 PMArkadii Ivanov
04/30/2022, 11:52 PMBig Chungus
05/01/2022, 12:06 AMArkadii Ivanov
05/01/2022, 12:13 AMOmar Shehe
05/02/2022, 7:24 AMRouter.current.nanavigate("/task?page=1")
But I can't find a way to get the page number.
This returns null parameters.map
hfhbd
05/02/2022, 8:33 AMOmar Shehe
05/02/2022, 8:36 AMOmar Shehe
05/02/2022, 8:52 AMnavigate("/task/page=1")
instead of navigate("/task?page=1")
All good 👍