babel_transform: Transform Code with Babel

Description Usage Arguments Value Examples

View source: R/babel.R

Description

Helper function to use V8 with Babel so we can avoid a JSX transformer with using reactR.

Usage

1
babel_transform(code = "")

Arguments

code

character

Value

transformed character

Examples

1
2
3
4
5
## Not run: 
library(reactR)
babel_transform('<div>react div</div>')

## End(Not run)

Example output

Loading required namespace: V8
[1] "React.createElement(\n  \"div\",\n  null,\n  \"react div\"\n);"

reactR documentation built on Feb. 22, 2021, 5:05 p.m.