Skip to content

Commit 6f8d3f4

Browse files
authored
Merge pull request #7 from lgnbhl/arg-reloadDocument
`reloadDocument` argument FALSE by default in `Link()` and `NavLink()`.
2 parents 46709d0 + 8a8068d commit 6f8d3f4

4 files changed

Lines changed: 17 additions & 14 deletions

File tree

R/components.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ Route <- function(..., element, key = uuid::UUIDgenerate()) {
7575
#' Link
7676
#'
7777
#' The `reloadDocument` can be used to skip client side routing and let the
78-
#' browser handle the transition normally (as if it were an <a href>). In
79-
#' React Router v6 `reloadDocument` if `FALSE`, but given shiny behavior, the
80-
#' `Link()` function makes it `TRUE` by default.
78+
#' browser handle the transition normally (as if it were an <a href>). Given
79+
#' shiny behavior, using `reloadDocument = TRUE` allows to render correctly
80+
#' objects created in the server side.
8181
#'
8282
#' @rdname Link
8383
#' @param ... Props to pass to element.
84-
#' @param reloadDocument Boolean. Default TRUE. Let browser handle the transition normally
84+
#' @param reloadDocument Boolean. Default FALSE.
8585
#' @return A Link component.
8686
#' @export
8787
Link <- function(..., reloadDocument = TRUE) {
@@ -107,13 +107,13 @@ Navigate <- component('Navigate')
107107
#' NavLink
108108
#'
109109
#' The `reloadDocument` can be used to skip client side routing and let the
110-
#' browser handle the transition normally (as if it were an <a href>). In
111-
#' React Router v6 `reloadDocument` if `FALSE`, but given shiny behavior, the
112-
#' `NavLink()` function makes it `TRUE` by default.
110+
#' browser handle the transition normally (as if it were an <a href>). Given
111+
#' shiny behavior, using `reloadDocument = TRUE` allows to render correctly
112+
#' objects created in the server side.
113113
#'
114114
#' @rdname NavLink
115115
#' @param ... Props to pass to element.
116-
#' @param reloadDocument Boolean. Default TRUE. Let browser handle the transition normally
116+
#' @param reloadDocument Boolean. Default FALSE.
117117
#' @return A NavLink component.
118118
#' @export
119119
NavLink <- function(..., reloadDocument = TRUE) {

inst/examples/dynamic-segment/app.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,22 @@ ui <- reactRouter::HashRouter(
9090
nav_item(
9191
NavLink(
9292
to = "overview",
93+
reloadDocument = TRUE,
9394
"Overview"
9495
)
9596
),
9697
nav_item(
9798
NavLink(
9899
to = "analysis",
100+
reloadDocument = TRUE,
99101
"Analysis"
100102
)
101103
),
102104
bslib::nav_spacer(),
103105
nav_item(
104106
NavLink(
105107
to = "/",
108+
reloadDocument = TRUE,
106109
shiny::icon("home")
107110
)
108111
),

man/Link.Rd

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/NavLink.Rd

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)