React: React component builder.

Description Usage Format Details Examples

Description

React is a syntactically-convenient way to create instances of React components that can be sent to the browser for display. It is a list for which extract methods are defined, allowing object creation syntax like React$MyComponent(x = 1) where MyComponent is a React component you have exposed to Shiny in JavaScript.

Usage

1

Format

An object of class react_component_builder of length 0.

Details

Internally, the component function is used to create the component instance.

Examples

1
2
3
4
5
6
7
8
# Create an instance of ParentComponent with two children,
# ChildComponent and OtherChildComponent.
React$ParentComponent(
  x = 1,
  y = 2,
  React$ChildComponent(),
  React$OtherChildComponent()
)

Example output

<ParentComponent x="1" y="2">
  <ChildComponent></ChildComponent>
  <OtherChildComponent></OtherChildComponent>
</ParentComponent>

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