Module: LucidPaper::App::NativeComponentConstructor
- Defined in:
- lib/isomorfeus_react_paper/lucid_paper/app/native_component_constructor.rb
Class Method Summary collapse
-
.extended(base) ⇒ Object
for should_component_update we apply ruby semantics for comparing props to do so, we convert the props to ruby hashes and then compare this makes sure, that for example rubys Nil object gets handled properly.
Class Method Details
.extended(base) ⇒ Object
for should_component_update we apply ruby semantics for comparing props to do so, we convert the props to ruby hashes and then compare this makes sure, that for example rubys Nil object gets handled properly
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/isomorfeus_react_paper/lucid_paper/app/native_component_constructor.rb', line 7 def self.extended(base) %x{ base.jss_theme = Opal.global.Paper.DefaultTheme; base.themed_component = Opal.global.Paper.withTheme(base.lucid_react_component); base.react_component = class extends Opal.global.React.Component { constructor(props) { super(props); if (Opal.Isomorfeus.$top_component() == nil) { Opal.Isomorfeus['$top_component='](this); } } static get displayName() { return "IsomorfeusTopLevelComponent"; } static set displayName(new_name) { // dont do anything here except returning the set value return new_name; } render() { let themed_component = Opal.global.React.createElement(base.themed_component, this.props); return Opal.global.React.createElement(Opal.global.Paper.Provider, { theme: base.jss_theme }, themed_component); } } } end |