Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions R/components.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ Route <- function(..., element, key = uuid::UUIDgenerate()) {
#' Link
#'
#' The `reloadDocument` can be used to skip client side routing and let the
#' browser handle the transition normally (as if it were an <a href>). In
#' React Router v6 `reloadDocument` if `FALSE`, but given shiny behavior, the
#' `Link()` function makes it `TRUE` by default.
#' browser handle the transition normally (as if it were an <a href>). Given
#' shiny behavior, using `reloadDocument = TRUE` allows to render correctly
#' objects created in the server side.
#'
#' @rdname Link
#' @param ... Props to pass to element.
#' @param reloadDocument Boolean. Default TRUE. Let browser handle the transition normally
#' @param reloadDocument Boolean. Default FALSE.
#' @return A Link component.
#' @export
Link <- function(..., reloadDocument = TRUE) {
Expand All @@ -107,13 +107,13 @@ Navigate <- component('Navigate')
#' NavLink
#'
#' The `reloadDocument` can be used to skip client side routing and let the
#' browser handle the transition normally (as if it were an <a href>). In
#' React Router v6 `reloadDocument` if `FALSE`, but given shiny behavior, the
#' `NavLink()` function makes it `TRUE` by default.
#' browser handle the transition normally (as if it were an <a href>). Given
#' shiny behavior, using `reloadDocument = TRUE` allows to render correctly
#' objects created in the server side.
#'
#' @rdname NavLink
#' @param ... Props to pass to element.
#' @param reloadDocument Boolean. Default TRUE. Let browser handle the transition normally
#' @param reloadDocument Boolean. Default FALSE.
#' @return A NavLink component.
#' @export
NavLink <- function(..., reloadDocument = TRUE) {
Expand Down
3 changes: 3 additions & 0 deletions inst/examples/dynamic-segment/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,22 @@ ui <- reactRouter::HashRouter(
nav_item(
NavLink(
to = "overview",
reloadDocument = TRUE,
"Overview"
)
),
nav_item(
NavLink(
to = "analysis",
reloadDocument = TRUE,
"Analysis"
)
),
bslib::nav_spacer(),
nav_item(
NavLink(
to = "/",
reloadDocument = TRUE,
shiny::icon("home")
)
),
Expand Down
6 changes: 3 additions & 3 deletions man/Link.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/NavLink.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.