Module: RailsUtil::ReactHelper
- Defined in:
- lib/rails_util/react_helper.rb
Overview
RailsUtil::ReactHelper contains wrapper methods for rendering React components using the react_on_rails gem
Instance Method Summary collapse
-
#render_component(component, options = {}) ⇒ Object
Helper method for rendering a React component to the DOM Note: A view file named
component.html.erbcontaining thereact_componentview helper is also required by this method.
Instance Method Details
#render_component(component, options = {}) ⇒ Object
Helper method for rendering a React component to the DOM
Note: A view file named component.html.erb containing the react_component view helper is also required by this method
18 19 20 |
# File 'lib/rails_util/react_helper.rb', line 18 def render_component(component, = {}) render 'component', locals: { component: component, options: } end |