Skip to content

Commit 885c035

Browse files
committed
Add @example for createReactInput
1 parent b8a26aa commit 885c035

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

R/reacttools.R

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,23 @@ reactMarkup <- function(tag) {
107107
#' @return Shiny input suitable for inclusion in a UI.
108108
#' @export
109109
#'
110+
#' @examples
111+
#' myInput <- function(inputId, default = "") {
112+
#' # The value of createReactInput should be returned from input constructor functions.
113+
#' createReactInput(
114+
#' inputId,
115+
#' "myinput",
116+
#' # At least one htmlDependency must be provided -- the JavaScript implementation of the input.
117+
#' htmlDependency(
118+
#' name = "my-input",
119+
#' version = "1.0.0",
120+
#' src = "www/mypackage/myinput",
121+
#' package = "mypackage",
122+
#' script = "myinput.js"
123+
#' ),
124+
#' default
125+
#' )
126+
#' }
110127
createReactInput <- function(inputId,
111128
class,
112129
dependencies,

man/createReactInput.Rd

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

0 commit comments

Comments
 (0)