Skip to content

Commit 5795e52

Browse files
committed
add documentation about useShinyjs() side effect and about using shinyjs in a package
1 parent cf70f09 commit 5795e52

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

R/useShinyjs.R

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
#' \code{shinyjs} functions to work.\cr\cr
55
#' You can call \code{useShinyjs()} from anywhere inside the UI, as long as the
66
#' final app UI contains the result of \code{useShinyjs()}.
7+
#'
8+
#' If you're a package author and including \code{shinyjs} in a function in your
9+
#' your package, you need to make sure \code{useShinyjs()} is called either by
10+
#' the end user's Shiny app or by your function's UI.
711
#'
812
#' @param rmd Set this to \code{TRUE} only if you are using \code{shinyjs}
913
#' inside an interactive R markdown document. If using this option, view the
@@ -19,7 +23,9 @@
1923
#' how to use shinyjs in these apps.
2024
#' @param showLog Deprecated.
2125
#' @return Scripts that \code{shinyjs} requires that are automatically inserted
22-
#' to the app's \code{<head>} tag.
26+
#' to the app's \code{<head>} tag. A side effect of calling this function is that
27+
#' a \code{shinyjs} directory is added as a resource path using
28+
#' \link[shiny]{addResourcePath}.
2329
#' @examples
2430
#' if (interactive()) {
2531
#' library(shiny)

man/useShinyjs.Rd

+8-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)