Skip to content

Commit 5a80783

Browse files
committed
reactMarkup: error if tag isn't shiny.tag or string
1 parent af330c9 commit 5a80783

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

R/reacttools.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ React <- structure(
8484
#'
8585
#' @examples
8686
reactMarkup <- function(tag) {
87-
# TODO ensure tag is either an htmltools tag or a string (throw otherwise)
88-
list(tag = tag)
87+
stopifnot(class(tag) == "shiny.tag"
88+
|| (is.character(tag) && length(tag) == 1))
89+
list(tag = tag, class = "reactR.markup")
8990
}
9091

0 commit comments

Comments
 (0)