Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit 2f0e8b2

Browse files
committed
remove Hash.new, its done in api.rb
1 parent e144766 commit 2f0e8b2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/react/component.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,20 @@ def component_did_mount
7070
def component_will_receive_props(next_props)
7171
# need to rethink how this works in opal-react, or if its actually that useful within the react.rb environment
7272
# for now we are just using it to clear processed_params
73-
React::State.set_state_context_to(self) { self.run_callback(:before_receive_props, Hash.new(next_props)) }
73+
React::State.set_state_context_to(self) { self.run_callback(:before_receive_props, next_props) }
7474
rescue Exception => e
7575
self.class.process_exception(e, self)
7676
end
7777

7878
def component_will_update(next_props, next_state)
79-
React::State.set_state_context_to(self) { self.run_callback(:before_update, Hash.new(next_props), Hash.new(next_state)) }
79+
React::State.set_state_context_to(self) { self.run_callback(:before_update, next_props, next_state) }
8080
rescue Exception => e
8181
self.class.process_exception(e, self)
8282
end
8383

8484
def component_did_update(prev_props, prev_state)
8585
React::State.set_state_context_to(self) do
86-
self.run_callback(:after_update, Hash.new(prev_props), Hash.new(prev_state))
86+
self.run_callback(:after_update, prev_props, prev_state)
8787
React::State.update_states_to_observe
8888
end
8989
rescue Exception => e

0 commit comments

Comments
 (0)