Module: Proscenium::ReactComponentable

Extended by:
ActiveSupport::Concern
Included in:
Phlex::ReactComponent, ViewComponent::ReactComponent
Defined in:
lib/proscenium/react_componentable.rb

Instance Method Summary collapse

Instance Method Details

#initialize(lazy: self.class.lazy, loader: self.class.loader, props: {}) ⇒ Object

Parameters:

  • props: (Hash) (defaults to: {})


54
55
56
57
58
# File 'lib/proscenium/react_componentable.rb', line 54

def initialize(lazy: self.class.lazy, loader: self.class.loader, props: {})
  self.lazy = lazy
  self.loader = loader
  @props = props
end

#propsObject



65
66
67
# File 'lib/proscenium/react_componentable.rb', line 65

def props
  @props ||= {}
end

#virtual_pathObject

The absolute URL path to the javascript component.



61
62
63
# File 'lib/proscenium/react_componentable.rb', line 61

def virtual_path
  @virtual_path ||= Resolver.resolve self.class.source_path.sub_ext('.jsx').to_s
end