React Helpers

Make it easy to use 'react' in R with helper dependency functions, embedded 'Babel' transpiler, and examples. Please note the separate 'react' BSD license < https://github.com/facebook/react/blob/master/LICENSE> when using 'react' in your projects.


A set of convenience function with local dependencies for using React in R. This is modeled after the html_dependency_* functions from RStudio's rmarkdown package.

You can install reactR from github with:

# install.packages("devtools")
devtools::install_github("timelyportfolio/reactR")
library(reactR)
library(htmltools)
 
browsable(attachDependencies(
  tags$script(
  "
    ReactDOM.render(
      React.createElement(
        'h1',
        null,
        'Powered by React'
      ),
      document.body
    )
  "
  ),
  html_dependency_react()
))

reactR also uses V8 if available to transform JSX and ES2015 code.

library(reactR)
library(htmltools)
 
browsable(
  attachDependencies(
    tags$script(
      babel_transform('ReactDOM.render(<h1>Powered By React/JSX</h1>,document.body)')
    ),
    html_dependency_react()
  )
)

I welcome contributors. Help make this package great. Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

News

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("reactR")

0.1.3 by Kent Russell, 9 days ago


https://github.com/timelyportfolio/reactR


Report a bug at https://github.com/timelyportfolio/reactR/issues


Browse source code at https://github.com/cran/reactR


Authors: Facebook Inc [aut, cph] (React library in lib, https://facebook.github.io/react; see AUTHORS for full list of contributors), Kent Russell [aut, cre] (R interface)


Documentation:   PDF Manual  


BSD_3_clause + file LICENSE license


Imports htmltools

Suggests htmlwidgets, rmarkdown, shiny, V8, knitr


Enhanced by listviewer.


See at CRAN