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

Commit f9eb077

Browse files
committed
Fix #params accessing with the updated PropsWrapper
There is no need to update props_wrapper in lifecycle any more ,according to 0700a46
1 parent 742b02b commit f9eb077

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

lib/react/component.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ def emit(event_name, *args)
5151

5252
def component_will_mount
5353
IsomorphicHelpers.load_context(true) if IsomorphicHelpers.on_opal_client?
54-
@props_wrapper = self.class.props_wrapper.new(Hash.new(`#{@native}.props`))
5554
set_state! initial_state if initial_state
5655
State.initialize_states(self, initial_state)
5756
State.set_state_context_to(self) { self.run_callback(:before_mount) }
@@ -104,7 +103,6 @@ def should_component_update?(next_props, next_state)
104103

105104
def component_will_update(next_props, next_state)
106105
State.set_state_context_to(self) { self.run_callback(:before_update, Hash.new(next_props), Hash.new(next_state)) }
107-
@props_wrapper = self.class.props_wrapper.new(Hash.new(next_props), @props_wrapper)
108106
rescue Exception => e
109107
self.class.process_exception(e, self)
110108
end

lib/react/component/dsl_instance_methods.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def children
88
end
99

1010
def params
11-
@props_wrapper
11+
@params ||= self.class.props_wrapper.new(self)
1212
end
1313

1414
def props

0 commit comments

Comments
 (0)