Skip to content

Commit

Permalink
fix(react): CDN template updated URL #16
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnCoene committed Nov 11, 2021
1 parent a73e256 commit 8749362
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions inst/templates/react/react_cdn.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
#' @param version Version of React to use, if `NULL` uses the latest
#'
#' @keywords internal
reactCDN <- function(version = NULL){
reactCDN <- function(version = 17){
unpkg <- "https://unpkg.com"

version_string <- ""
if(!is.null(version))
version_string <- sprintf("@%d", version)
version_string <- sprintf("@%d", version)

react <- sprintf("%s/react%s/umd/react.production.min.js", unpkg, version_string)
react_dom <- sprintf("%s/react%s/umd/react-dom.production.min.js", unpkg, version_string)
react_dom <- sprintf("%s/react-dom%s/umd/react-dom.production.min.js", unpkg, version_string)
shiny::singleton(
shiny::tags$head(
shiny::tags$script(src = react, crossorigin = NA),
Expand Down

0 comments on commit 8749362

Please sign in to comment.