Learn R Programming

shinyChakraUI (version 1.1.1)

jsxString2code: JSX string to React component code

Description

Given a JSX string, this function prints the code of the corresponding React component that can be used in chakraComponent.

Usage

jsxString2code(jsxString, clipboard = TRUE)

Arguments

jsxString

JSX code given as a string

clipboard

whether to copy the output to the clipboard

Value

No return value, only prints the code in the console and copy it to the clipboard if clipboard = TRUE.

Examples

Run this code
# NOT RUN {
jsxString <- '<Input type="email" id="myinput" />'
# }
# NOT RUN {
jsxString2code(jsxString)
# }
# NOT RUN {
jsxString <- '<Button onClick={() => alert("hello")}>Hello</Button>'
# }
# NOT RUN {
jsxString2code(jsxString)
# }

Run the code above in your browser using DataLab