Skip to content

Commit 97c018a

Browse files
committed
fixed remaining regression
1 parent d398fd3 commit 97c018a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ruby/hyper-component/lib/hyperstack/internal/component/react_wrapper.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,9 @@ def self.create_element(type, *args, &block)
178178
end
179179

180180
# Convert Passed in properties
181-
ele = nil
182-
properties = convert_props(type, { ref: ->(ref) { ele._update_ref(ref) } }, *args)
181+
ele = nil # create nil var for the ref to use
182+
ref = ->(ref) { ele._update_ref(ref) } unless `typeof ncc === 'function'`
183+
properties = convert_props(type, { ref: ref }, *args)
183184
params << properties.shallow_to_n
184185

185186
# Children Nodes
@@ -257,6 +258,7 @@ def self.convert_props(type, *args)
257258
props[key] = value
258259

259260
elsif key == 'ref'
261+
next unless value
260262
unless value.respond_to?(:call)
261263
raise "The ref and dom params must be given a Proc.\n"\
262264
"If you want to capture the ref in an instance variable use the `set` method.\n"\

0 commit comments

Comments
 (0)