Sha256: 3daab87c610fac299af2f033cc96da63f16cf3cc383ca0fbf5d29803c1609b5d
Contents?: true
Size: 1.1 KB
Versions: 14
Compression:
Stored size: 1.1 KB
Contents
module React module Component module UnsafeAPI def self.included(base) base.instance_exec do def unsafe_component_will_mount(&block) %x{ self.react_component.prototype.UNSAFE_componentWillMount = function() { return #{`this.__ruby_instance`.instance_exec(&block)}; } } end def unsafe_component_will_receive_props(&block) %x{ self.react_component.prototype.UNSAFE_componentWillReceiveProps = function(next_props) { return #{`this.__ruby_instance`.instance_exec(React::Component::Props.new(`next_props`), &block)}; } } end def unsafe_component_will_update(&block) %x{ self.react_component.prototype.UNSAFE_componentWillUpdate = function(next_props, next_state) { return #{`this.__ruby_instance`.instance_exec(React::Component::Props.new(`next_props`), `Opal.Hash.$new(next_state)`, &block)}; } } end end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems