% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dependencies.R
\name{html_dependency_react}
\alias{html_dependency_react}
\title{Dependencies for React}
\usage{
html_dependency_react(offline = TRUE)
}
\arguments{
\item{offline}{\code{logical} to use local file dependencies.  If \code{FALSE},
then the dependencies use the Facebook cdn as its \code{src}.
To use with \code{JSX} see \code{\link{babel_transform}}.}
}
\value{
\code{\link[htmltools]{htmlDependency}}
}
\description{
Add JavaScript 'React' dependency.  For this to work in RStudio Viewer, also include
\code{\link{html_dependency_corejs}}.
}
\examples{
library(reactR)
library(htmltools)

tagList(
  tags$script(
  "
    ReactDOM.render(
      React.createElement(
        'h1',
        null,
        'Powered by React'
      ),
      document.body
    )
  "
  ),
   #add core-js first to work in RStudio Viewer
  html_dependency_corejs(),
  html_dependency_react() #offline=FALSE for CDN
)
}
