@@ -23,15 +23,6 @@ def append_backtrace(message_array, backtrace)
2323 backtrace [ 1 ..-1 ] . each { |line | message_array << line }
2424 end
2525
26- def deprecation_warning ( message )
27- @deprecation_messages ||= [ ]
28- message = "Warning: Deprecated feature used in #{ name } . #{ message } "
29- unless @deprecation_messages . include? message
30- @deprecation_messages << message
31- IsomorphicHelpers . log message , :warning
32- end
33- end
34-
3526 def render ( container = nil , params = { } , &block )
3627 define_method :render do
3728 if container
@@ -128,16 +119,16 @@ def export_state(*states, &block)
128119
129120 def define_state_methods ( this , name , from = nil , &block )
130121 this . define_method ( "#{ name } " ) do
131- self . class . deprecation_warning "Direct access to state `#{ name } `. Use `state.#{ name } ` instead." if from . nil? || from == this
122+ React :: Component . deprecation_warning "Direct access to state `#{ name } `. Use `state.#{ name } ` instead." if from . nil? || from == this
132123 State . get_state ( from || self , name )
133124 end
134125 this . define_method ( "#{ name } =" ) do |new_state |
135- self . class . deprecation_warning "Direct assignment to state `#{ name } `. Use `#{ ( from && from != this ) ? from : 'state' } .#{ name } !` instead."
126+ React :: Component . deprecation_warning "Direct assignment to state `#{ name } `. Use `#{ ( from && from != this ) ? from : 'state' } .#{ name } !` instead."
136127 yield name , State . get_state ( from || self , name ) , new_state if block && block . arity > 0
137128 State . set_state ( from || self , name , new_state )
138129 end
139130 this . define_method ( "#{ name } !" ) do |*args |
140- self . class . deprecation_warning "Direct access to state `#{ name } `. Use `state.#{ name } ` instead." if from . nil? or from == this
131+ React :: Component . deprecation_warning "Direct access to state `#{ name } `. Use `state.#{ name } ` instead." if from . nil? or from == this
141132 if args . count > 0
142133 yield name , State . get_state ( from || self , name ) , args [ 0 ] if block && block . arity > 0
143134 current_value = State . get_state ( from || self , name )
0 commit comments