react has become incredibly popular, and the ecosystem around react is robust. reactR aims to allow R users to more easily incorporate react and JSX.
install.packages("reactR")
# for the latest development version
# install from Github
# devtools::install_github("timelyportfolio/reactR")
Let’s use react to render a simple h1 HTML element below.
library(reactR)
library(htmltools)
attachDependencies(
tags$script(
"
ReactDOM.render(
React.createElement(
'h1',
null,
'Powered by React'
),
document.getElementById('react-heading-here')
)
"
),
html_dependency_react()
)