Class: JsonSchemaView::Renderers::ReactOnRails

Inherits:
Base
  • Object
show all
Defined in:
lib/json_schema_view/renderers/react_on_rails.rb

Overview

Render a React component by using https://github.com/shakacode/react_on_rails.

Instance Attribute Summary

Attributes inherited from Base

#component

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from JsonSchemaView::Renderers::Base

Instance Method Details

#render_in(view_context, **options) ⇒ String

Parameters:

  • view_content (Object)

Returns:

  • (String)


12
13
14
# File 'lib/json_schema_view/renderers/react_on_rails.rb', line 12

def render_in(view_context, **options)
  view_context.react_component(component.component_name, props: component.props.as_json, **options)
end