Skip to content

Commit 2305746

Browse files
committed
Rename reactData => reactMarkup
1 parent 79ca0d1 commit 2305746

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

R/reacttools.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,18 @@ React <- structure(
9898
#' @export
9999
`[[<-.react_component_builder` <- `$<-.react_component_builder`
100100

101-
#' Create a data object for sending a React component to the client.
101+
#' Prepare data that represents a character vector, a React component, or an
102+
#' htmltools tag for sending to the client.
102103
#'
103-
#' @param tag React component or \code{\link[htmltools]{tag}}
104+
#' @param tag character vector or React component or
105+
#' \code{\link[htmltools]{tag}}
104106
#'
105107
#' @return
106108
#' @export
107109
#'
108110
#' @examples
109-
reactData <- function(tag) {
111+
reactMarkup <- function(tag) {
112+
# TODO ensure tag is either an htmltools tag or a string (throw otherwise)
110113
list(tag = tag)
111114
}
112115

inst/templates/widget_r.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
%s <- function(message, width = NULL, height = NULL, elementId = NULL) {
99

1010
# describe a React component to send to the browser for rendering.
11-
component <- reactR::reactData(htmltools::tag("div", list(message)))
11+
component <- reactR::reactMarkup(htmltools::tag("div", list(message)))
1212

1313
# create widget
1414
htmlwidgets::createWidget(

0 commit comments

Comments
 (0)