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

Commit 150a7b8

Browse files
committed
native import was generating deprecation warning
1 parent d2e97f6 commit 150a7b8

File tree

2 files changed

+36
-34
lines changed

2 files changed

+36
-34
lines changed

lib/react/native_library.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def create_component_wrapper(klass, native_name, ruby_name)
7272
if React::API.native_react_component?(native_name)
7373
new_klass = klass.const_set ruby_name, Class.new
7474
new_klass.class_eval do
75-
include React::Component
75+
include Hyperloop::Component::Mixin
7676
imports native_name
7777
end
7878
new_klass

spec/react/param_declaration_spec.rb

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -202,39 +202,41 @@ def render
202202
expect(Foo).to render_static_html('<span>2</span>').with_params(foo: {bazwoggle: 1})
203203
end
204204

205-
it "even if contains an embedded native object" do
206-
pending 'Fix after merging'
207-
stub_const "Bar", Class.new(React::Component::Base)
208-
stub_const "BazWoggle", Class.new
209-
BazWoggle.class_eval do
210-
def initialize(kind)
211-
@kind = kind
212-
end
213-
attr_accessor :kind
214-
def self._react_param_conversion(json, validate_only)
215-
new(JSON.from_object(json[0])[:bazwoggle]) if JSON.from_object(json[0])[:bazwoggle]
216-
end
217-
end
218-
Bar.class_eval do
219-
param :foo, type: BazWoggle
220-
def render
221-
params.foo.kind.to_s
222-
end
223-
end
224-
Foo.class_eval do
225-
export_state :change_me
226-
before_mount do
227-
Foo.change_me! "initial"
228-
end
229-
def render
230-
Bar(foo: Native([`{bazwoggle: #{Foo.change_me}}`]))
231-
end
232-
end
233-
div = `document.createElement("div")`
234-
React.render(React.create_element(Foo, {}), div)
235-
Foo.change_me! "updated"
236-
expect(`div.children[0].innerHTML`).to eq("updated")
237-
end
205+
it "even if contains an embedded native object"
206+
# its not clear what this test was trying to accomplish...
207+
# do
208+
# pending 'Fix after merging'
209+
# stub_const "Bar", Class.new(React::Component::Base)
210+
# stub_const "BazWoggle", Class.new
211+
# BazWoggle.class_eval do
212+
# def initialize(kind)
213+
# @kind = kind
214+
# end
215+
# attr_accessor :kind
216+
# def self._react_param_conversion(json, validate_only)
217+
# new(JSON.from_object(json[0])[:bazwoggle]) if JSON.from_object(json[0])[:bazwoggle]
218+
# end
219+
# end
220+
# Bar.class_eval do
221+
# param :foo, type: BazWoggle
222+
# def render
223+
# params.foo.kind.to_s
224+
# end
225+
# end
226+
# Foo.class_eval do
227+
# export_state :change_me
228+
# before_mount do
229+
# Foo.change_me! "initial"
230+
# end
231+
# def render
232+
# Bar(foo: Native([`{bazwoggle: #{Foo.change_me}}`]))
233+
# end
234+
# end
235+
# div = `document.createElement("div")`
236+
# React.render(React.create_element(Foo, {}), div)
237+
# Foo.change_me! "updated"
238+
# expect(`div.children[0].innerHTML`).to eq("updated")
239+
# end
238240
end
239241

240242
it "will alias a Proc type param" do

0 commit comments

Comments
 (0)