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

Commit 4727fbc

Browse files
catmandozetachang
authored andcommittedSep 27, 2016
WIP
# Conflicts: # .rubocop.yml -> removed # config.ru -> removed # lib/react/component.rb # lib/react/native_library.rb # lib/reactive-ruby/rails/controller_helper.rb -> removed # spec/react/dsl_spec.rb # spec/spec_helper.rb -> removed
1 parent f747191 commit 4727fbc

File tree

9 files changed

+544
-57
lines changed

9 files changed

+544
-57
lines changed
 

‎component-name-lookup.md

+145
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
#### Notes on how component names are looked up
2+
3+
Given:
4+
5+
```ruby
6+
7+
class Blat < React::Component::Base
8+
9+
render do
10+
Bar()
11+
Foo::Bar()
12+
end
13+
14+
end
15+
16+
class Bar < React::Component::Base
17+
end
18+
19+
module Foo
20+
21+
class Bar < React::Component::Base
22+
23+
render do
24+
Blat()
25+
Baz()
26+
end
27+
end
28+
29+
class Baz < React::Component::Base
30+
end
31+
32+
end
33+
```
34+
35+
The problem is that method lookup is different than constant lookup. We can prove it by running this code:
36+
37+
```ruby
38+
def try_it(test, &block)
39+
puts "trying #{test}"
40+
result = yield
41+
puts "success#{': '+result.to_s if result}"
42+
rescue Exception => e
43+
puts "failed: #{e}"
44+
ensure
45+
puts "---------------------------------"
46+
end
47+
48+
module Boom
49+
50+
Bar = 12
51+
52+
def self.Bar
53+
puts " Boom::Bar says hi"
54+
end
55+
56+
class Baz
57+
def doit
58+
try_it("Bar()") { Bar() }
59+
try_it("Boom::Bar()") {Boom::Bar()}
60+
try_it("Bar") { Bar }
61+
try_it("Boom::Bar") { Boom::Bar }
62+
end
63+
end
64+
end
65+
66+
67+
68+
Boom::Baz.new.doit
69+
```
70+
71+
which prints:
72+
73+
```text
74+
trying Bar()
75+
failed: Bar: undefined method `Bar' for #<Boom::Baz:0x774>
76+
---------------------------------
77+
trying Boom::Bar()
78+
Boom::Bar says hi
79+
success
80+
---------------------------------
81+
trying Bar
82+
success: 12
83+
---------------------------------
84+
trying Boom::Bar
85+
success: 12
86+
---------------------------------
87+
```
88+
89+
[try-it](http://opalrb.org/try/?code:def%20try_it(test%2C%20%26block)%0A%20%20puts%20%22trying%20%23%7Btest%7D%22%0A%20%20result%20%3D%20yield%0A%20%20puts%20%22success%23%7B%27%3A%20%27%2Bresult.to_s%20if%20result%7D%22%0Arescue%20Exception%20%3D%3E%20e%0A%20%20puts%20%22failed%3A%20%23%7Be%7D%22%0Aensure%0A%20%20puts%20%22---------------------------------%22%0Aend%0A%0Amodule%20Boom%0A%20%20%0A%20%20Bar%20%3D%2012%0A%20%20%0A%20%20def%20self.Bar%0A%20%20%20%20puts%20%22%20%20%20Boom%3A%3ABar%20says%20hi%22%0A%20%20end%0A%0A%20%20class%20Baz%0A%20%20%20%20def%20doit%0A%20%20%20%20%20%20try_it(%22Bar()%22)%20%7B%20Bar()%20%7D%0A%20%20%20%20%20%20try_it(%22Boom%3A%3ABar()%22)%20%7BBoom%3A%3ABar()%7D%0A%20%20%20%20%20%20try_it(%22Bar%22)%20%7B%20Bar%20%7D%0A%20%20%20%20%20%20try_it(%22Boom%3A%3ABar%22)%20%7B%20Boom%3A%3ABar%20%7D%0A%20%20%20%20end%0A%20%20end%0Aend%0A%20%20%0A%0A%0ABoom%3A%3ABaz.new.doit)
90+
91+
92+
What we need to do is:
93+
94+
1. when defining a component class `Foo`, also define in the same scope that Foo is being defined a method `self.Foo` that will accept Foo's params and child block, and render it.
95+
96+
2. As long as a name is qualified with at least one scope (i.e. `ModName::Foo()`) everything will work out, but if we say just `Foo()` then the only way I believe out of this is to handle it via method_missing, and let method_missing do a const_get on the method_name (which will return the class) and then render that component.
97+
98+
#### details
99+
100+
To define `self.Foo` in the same scope level as the class `Foo`, we need code like this:
101+
102+
```ruby
103+
def register_component_dsl_method(component)
104+
split_name = component.name && component.name.split('::')
105+
return unless split_name && split_name.length > 2
106+
component_name = split_name.last
107+
parent = split_name.inject([Module]) { |nesting, next_const| nesting + [nesting.last.const_get(next_const)] }[-2]
108+
class << parent
109+
define_method component_name do |*args, &block|
110+
React::RenderingContext.render(name, *args, &block)
111+
end
112+
define_method "#{component_name}_as_node" do |*args, &block|
113+
React::Component.deprecation_warning("..._as_node is deprecated. Render component and then use the .node method instead")
114+
send(component_name, *args, &block).node
115+
end
116+
end
117+
end
118+
119+
module React
120+
module Component
121+
def self.included(base)
122+
...
123+
register_component_dsl_method(base.name)
124+
end
125+
end
126+
end
127+
```
128+
129+
The component's method_missing function will look like this:
130+
131+
```ruby
132+
def method_missing(name, *args, &block)
133+
if name =~ /_as_node$/
134+
React::Component.deprecation_warning("..._as_node is deprecated. Render component and then use the .node method instead")
135+
method_missing(name.gsub(/_as_node$/,""), *args, &block).node
136+
else
137+
component = const_get name if defined? name
138+
React::RenderingContext.render(nil, component, *args, &block)
139+
end
140+
end
141+
```
142+
143+
### other related issues
144+
145+
The Kernel#p method conflicts with the <p> tag. However the p method can be invoked on any object so we are going to go ahead and use it, and deprecate the para method.

‎lib/react/api.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class API
55
@@component_classes = {}
66

77
def self.import_native_component(opal_class, native_class)
8-
@@component_classes[opal_class.to_s] = native_class
8+
@@component_classes[opal_class] = native_class
99
end
1010

1111
def self.create_native_react_class(type)

‎lib/react/component.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ def self.included(base)
2929
base.extend(ClassMethods)
3030

3131
if base.name
32-
class << base.parent
32+
parent = base.name.split("::").inject([Module]) { |nesting, next_const| nesting + [nesting.last.const_get(next_const)] }[-2]
33+
class << parent
3334
def method_missing(n, *args, &block)
3435
name = n
3536
if name =~ /_as_node$/

‎lib/react/component/class_methods.rb

+17-5
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,20 @@ def deprecation_warning(message)
2727
end
2828
end
2929

30-
def render(*args, &block)
31-
if args[0].is_a? Hash
32-
define_method :render do
33-
yield
30+
def render(container=nil, params={}, &block)
31+
if container
32+
if block
33+
define_method :render do
34+
send(container, params) { instance_eval &block }
35+
end
36+
else
37+
define_method :render do
38+
send(container, params)
39+
end
3440
end
3541
else
3642
define_method :render do
37-
send *args, &block
43+
instance_eval &block
3844
end
3945
end
4046
end
@@ -174,6 +180,12 @@ def export_component(opts = {})
174180
Native(`window`)[first_name] = add_item_to_tree(Native(`window`)[first_name], [React::API.create_native_react_class(self)] + export_name[1..-1].reverse).to_n
175181
end
176182

183+
def imports(native_component_name)
184+
React::API.import_native_component(native_component_name, self)
185+
render {} # define a dummy render method - will never be called...
186+
self
187+
end
188+
177189
def add_item_to_tree(current_tree, new_item)
178190
if Native(current_tree).class != Native::Object || new_item.length == 1
179191
new_item.inject { |memo, sub_name| { sub_name => memo } }

‎lib/react/native_library.rb

+71-36
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,88 @@
11
module React
2+
# NativeLibrary handles importing JS libraries
3+
# Importing native components is handled by the
4+
# React::Base.
25
class NativeLibrary
3-
def self.renames_and_exclusions
4-
@renames_and_exclusions ||= {}
5-
end
6+
class << self
7+
def imports(native_name)
8+
@native_prefix = "#{native_name}."
9+
self
10+
end
611

7-
def self.libraries
8-
@libraries ||= []
9-
end
12+
def rename(rename_list)
13+
# rename_list is a hash in the form: native_name => ruby_name, native_name => ruby_name
14+
rename_list.each do |js_name, ruby_name|
15+
native_name = lookup_native_name(js_name)
16+
if lookup_native_name(js_name)
17+
create_wrapper(native_name, ruby_name)
18+
else
19+
raise "class #{name} < React::NativeLibrary could not import #{js_name}. "\
20+
"Native value #{scope_native_name(js_name)} is undefined."
21+
end
22+
end
23+
end
1024

11-
def self.const_missing(name)
12-
if renames_and_exclusions.has_key? name
13-
if native_name = renames_and_exclusions[name]
14-
native_name
25+
def import_const_from_native(klass, const_name)
26+
puts "#{klass} is importing_const_from_native: #{const_name}"
27+
if klass.defined? const_name
28+
klass.const_get const_name
1529
else
16-
super
30+
native_name = lookup_native_name(const_name) ||
31+
lookup_native_name(const_name[0].downcase + const_name[1..-1])
32+
wrapper = create_wrapper(klass, native_name, const_name) if native_name
33+
puts "created #{wrapper} for #{const_name}"
34+
wrapper
1735
end
18-
else
19-
libraries.each do |library|
20-
native_name = "#{library}.#{name}"
21-
native_component = `eval(#{native_name})` rescue nil
22-
React::API.import_native_component(name, native_component) and return name if native_component && `native_component != undefined`
36+
end
37+
38+
def find_and_render_component(container_class, component_name, args, block, &_failure)
39+
puts "#{self} is registering #{method_name}"
40+
component_class = import_const_from_native(container_class, method_name)
41+
if component_class < React::Component::Base
42+
React::RenderingContext.build_or_render(nil, component_class, *args, &block)
43+
else
44+
yield method_name
2345
end
24-
name
2546
end
26-
end
2747

28-
def self.method_missing(n, *args, &block)
29-
name = n
30-
if name =~ /_as_node$/
31-
node_only = true
32-
name = name.gsub(/_as_node$/, "")
48+
def const_missing(const_name)
49+
import_const_from_native(self, const_name) || super
3350
end
34-
unless name = const_get(name)
35-
return super
51+
52+
def method_missing(method_name, *args, &block)
53+
find_and_render_component(self, method_name, args, block) do
54+
raise "could not import a react component named: #{scope_native_name method_name}"
55+
end
3656
end
37-
React::RenderingContext.build_or_render(node_only, name, *args, &block)
38-
rescue
39-
end
4057

41-
def self.imports(library)
42-
libraries << library
43-
end
58+
private
4459

45-
def self.rename(rename_list={})
46-
renames_and_exclusions.merge!(rename_list.invert)
47-
end
60+
def lookup_native_name(js_name)
61+
native_name = scope_native_name(js_name)
62+
`eval(#{native_name}) !== undefined && native_name`
63+
rescue
64+
nil
65+
end
4866

49-
def self.exclude(*exclude_list)
50-
renames_and_exclusions.merge(Hash[exclude_list.map {|k| [k, nil]}])
67+
def scope_native_name(js_name)
68+
"#{@native_prefix}#{js_name}"
69+
end
70+
71+
def create_wrapper(klass, native_name, ruby_name)
72+
if React::API.import_native_component native_name
73+
puts "create wrapper(#{klass.inspect}, #{native_name}, #{ruby_name})"
74+
new_klass = Class.new
75+
klass.const_set ruby_name, new_klass
76+
new_class.class_eval do
77+
include React::Component::Base
78+
imports native_name
79+
end
80+
puts "successfully created #{klass.inspect}.#{ruby_name} wrapper class for #{native_name}"
81+
else
82+
puts "creating wrapper class #{klass}::#{ruby_name} for #{native_name}"
83+
klass.const_set ruby_name, Class.new(React::NativeLibrary).imports(native_name)
84+
end
85+
end
5186
end
5287
end
5388
end

‎lib/reactive-ruby/rails/component_mount.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ def setup(controller)
1010
def react_component(name, props = {}, options = {}, &block)
1111
options = context_initializer_options(options, name) if options[:prerender]
1212
props = serialized_props(props, name, controller)
13-
super(top_level_name, props, options, &block) + footers
13+
super(top_level_name, props, options, &block).gsub("\n","")
14+
.gsub(/(<script>.*<\/script>)<\/div>$/,'</div>\1').html_safe +
15+
footers
1416
end
1517

1618
private

‎lib/reactrb/auto-import.rb

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# rubocop:disable Style/FileName
2+
# require 'reactrb/auto-import' to automatically
3+
# import JS libraries and components when they are detected
4+
class Object
5+
class << self
6+
alias _reactrb_original_const_missing const_missing
7+
8+
def const_missing(const_name)
9+
# Opal uses const_missing to initially define things,
10+
# so we always call the original, and respond to the exception
11+
_reactrb_original_const_missing(const_name)
12+
rescue StandardError => e
13+
puts "Object const_missing: #{const_name}"
14+
React::NativeLibrary.import_const_from_native(Object, const_name) || raise(e)
15+
end
16+
17+
def xmethod_missing(method_name, *args, &block)
18+
puts "Object method_missing: #{method_name}"
19+
React::NativeLibrary.register_method(Object, method_name, args, block) do
20+
_reactrb_original_const_missing(method_name, *args, &block)
21+
end
22+
end
23+
end
24+
end

‎spec/react/dsl_spec.rb

+37-7
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,46 @@
33
if opal?
44
describe 'the React DSL' do
55

6-
it "can define the render method with the render macro", only: true do
7-
stub_const 'Foo', Class.new
8-
Foo.class_eval do
9-
include React::Component
10-
render(:div, class: :foot) do
11-
"hello"
6+
context "render macro" do
7+
8+
it "can define the render method with the render macro with a html tag container" do
9+
stub_const 'Foo', Class.new
10+
Foo.class_eval do
11+
include React::Component
12+
render(:div, class: :foo) do
13+
"hello"
14+
end
1215
end
16+
17+
expect(React.render_to_static_markup(React.create_element(Foo))).to eq('<div class="foo">hello</div>')
18+
end
19+
20+
it "can define the render method with the render macro without a container" do
21+
stub_const 'Foo', Class.new
22+
Foo.class_eval do
23+
include React::Component
24+
render do
25+
"hello"
26+
end
27+
end
28+
29+
expect(React.render_to_static_markup(React.create_element(Foo))).to eq('<span>hello</span>')
30+
end
31+
32+
it "can define the render method with the render macro with a application defined container" do
33+
stub_const 'Bar', Class.new(React::Component::Base)
34+
Bar.class_eval do
35+
param :p1
36+
render { "hello #{params.p1}" }
37+
end
38+
stub_const 'Foo', Class.new(React::Component::Base)
39+
Foo.class_eval do
40+
render Bar, p1: "fred"
41+
end
42+
43+
expect(React.render_to_static_markup(React.create_element(Foo))).to eq('<span>hello fred</span>')
1344
end
1445

15-
expect(React.render_to_static_markup(React.create_element(Foo))).to eq('<div class="foot">hello</div>')
1646
end
1747

1848
it "will turn the last string in a block into a element" do

‎spec/react/native_library_spec.rb

+244-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,248 @@
1-
require 'spec_helper'
1+
if false
2+
#require 'spec_helper'
3+
#require 'reactrb/auto-import'
24

35
if opal?
4-
describe React::NativeLibrary do
5-
it "will import a React.js library into the Ruby name space" # class BS < NativeLibrary; imports 'ReactBootstrap'; end
6-
it "exclude specific components from a library" # exclude "Modal" # can't access BS.Modal
7-
it "rename specific components from a library" # rename "Modal" => "FooBar" # BS.FooBar connects to ReactBootstrap.Modal
8-
it "can importan multiple libraries into one class"
6+
7+
module NativeLibraryTestModule
8+
class Component < React::Component::Base
9+
param :time_stamp
10+
render { puts "about to render Component"; NativeComponent(name: "There - #{params.time_stamp}") }
11+
end
12+
13+
class NestedComponent < React::Component::Base
14+
param :time_stamp
15+
render { puts "about to render NestedComponent"; NativeLibrary::NativeNestedLibrary::NativeComponent(name: "There - #{params.time_stamp}") }
16+
end
17+
end
18+
19+
describe "React::NativeLibrary", only: true do
20+
21+
after(:each) do
22+
%x{
23+
delete window.NativeLibrary;
24+
delete window.NativeComponent;
25+
delete window.nativeLibrary;
26+
delete window.nativeComponent;
27+
delete window.NativeObject;
28+
}
29+
Object.send :remove_const, :NativeLibrary
30+
Object.send :remove_const, :NativeComponent
31+
end
32+
33+
# it "will import a React.js library into the Ruby name space" do
34+
# %x{
35+
# window.NativeLibrary = {
36+
# NativeComponent: React.createClass({
37+
# displayName: "HelloMessage",
38+
# render: function render() {
39+
# return React.createElement("div", null, "Hello ", this.props.name);
40+
# }
41+
# })
42+
# }
43+
# }
44+
# stub_const 'Foo', Class.new(React::NativeLibrary)
45+
# Foo.class_eval do
46+
# imports "NativeLibrary"
47+
# end
48+
# expect(React.render_to_static_markup(
49+
# React.create_element(Foo::NativeComponent, name: "There"))).to eq('<div>Hello There</div>')
50+
# end
51+
#
52+
# it "will rename an imported a React.js component" do
53+
# %x{
54+
# window.NativeLibrary = {
55+
# NativeComponent: React.createClass({
56+
# displayName: "HelloMessage",
57+
# render: function render() {
58+
# return React.createElement("div", null, "Hello ", this.props.name);
59+
# }
60+
# })
61+
# }
62+
# }
63+
# stub_const 'Foo', Class.new(React::NativeLibrary)
64+
# Foo.class_eval do
65+
# imports "NativeLibrary"
66+
# rename "NativeComponent" => "Bar"
67+
# end
68+
# expect(React.render_to_static_markup(
69+
# React.create_element(Foo::Bar, name: "There"))).to eq('<div>Hello There</div>')
70+
# end
71+
#
72+
# it "will give a reasonable error when failing to import a renamed component" do
73+
# %x{
74+
# window.NativeLibrary = {
75+
# NativeComponent: React.createClass({
76+
# displayName: "HelloMessage",
77+
# render: function render() {
78+
# return React.createElement("div", null, "Hello ", this.props.name);
79+
# }
80+
# })
81+
# }
82+
# }
83+
# stub_const 'Foo', Class.new(React::NativeLibrary)
84+
# expect do
85+
# Foo.class_eval do
86+
# imports "NativeLibrary"
87+
# rename "MispelledComponent" => "Bar"
88+
# end
89+
# end.to raise_error(/could not import MispelledComponent/)
90+
# end
91+
#
92+
# it "will import a single React.js component into the ruby name space" do
93+
# %x{
94+
# window.NativeComponent = React.createClass({
95+
# displayName: "HelloMessage",
96+
# render: function render() {
97+
# return React.createElement("div", null, "Hello ", this.props.name);
98+
# }
99+
# })
100+
# }
101+
# stub_const 'Foo', Class.new(React::Component::Base)
102+
# Foo.class_eval do
103+
# imports "NativeComponent"
104+
# end
105+
# expect(React.render_to_static_markup(
106+
# React.create_element(Foo, name: "There"))).to eq('<div>Hello There</div>')
107+
#
108+
# end
109+
#
110+
# it "will import a name scoped React.js component into the ruby name space" do
111+
# %x{
112+
# window.NativeLibrary = {
113+
# NativeComponent: React.createClass({
114+
# displayName: "HelloMessage",
115+
# render: function render() {
116+
# return React.createElement("div", null, "Hello ", this.props.name);
117+
# }
118+
# })
119+
# }
120+
# }
121+
# stub_const 'Foo', Class.new(React::Component::Base)
122+
# Foo.class_eval do
123+
# imports "NativeLibrary.NativeComponent"
124+
# end
125+
# expect(React.render_to_static_markup(
126+
# React.create_element(Foo, name: "There"))).to eq('<div>Hello There</div>')
127+
#
128+
# end
129+
#
130+
# it "will give a meaningful error if the React.js component is invalid" do
131+
# %x{
132+
# window.NativeObject = {}
133+
# }
134+
# stub_const 'Foo', Class.new(React::Component::Base)
135+
# expect do
136+
# Foo.class_eval do
137+
# imports "NativeComponent"
138+
# end
139+
# end.to raise_error(/Cannot import NativeComponent: /)
140+
# expect do
141+
# Foo.class_eval do
142+
# imports "NativeObject"
143+
# end
144+
# end.to raise_error("Cannot import NativeObject: not a react native component")
145+
# end
146+
147+
context "automatic importing" do
148+
149+
it "will automatically import a React.js component when referenced in another component" do
150+
%x{
151+
window.NativeComponent = React.createClass({
152+
displayName: "HelloMessage",
153+
render: function render() {
154+
return React.createElement("div", null, "Hello ", this.props.name);
155+
}
156+
})
157+
}
158+
expect(React.render_to_static_markup(
159+
React.create_element(NativeLibraryTestModule::Component, time_stamp: Time.now))).to eq('<div>Hello There</div>')
160+
end
161+
162+
# it "will automatically import a React.js component when referenced in another component" do
163+
# stub_const 'Foo', Class.new(React::Component::Base)
164+
# Foo.class_eval do
165+
# render { NativeComponent(name: "There") }
166+
# end
167+
# %x{
168+
# window.NativeComponent = React.createClass({
169+
# displayName: "HelloMessage",
170+
# render: function render() {
171+
# return React.createElement("div", null, "Hello ", this.props.name);
172+
# }
173+
# })
174+
# }
175+
# expect(React.render_to_static_markup(
176+
# React.create_element(Foo))).to eq('<div>Hello There</div>')
177+
# end
178+
179+
# it "will automatically import a React.js component when referenced as a constant" do
180+
# %x{
181+
# window.NativeComponent = React.createClass({
182+
# displayName: "HelloMessage",
183+
# render: function render() {
184+
# return React.createElement("div", null, "Hello ", this.props.name);
185+
# }
186+
# })
187+
# }
188+
# expect(React.render_to_static_markup(
189+
# React.create_element(NativeComponent, name: "There"))).to eq('<div>Hello There</div>')
190+
# end
191+
192+
it "will automatically import a native library containing a React.js component" do
193+
%x{
194+
window.NativeLibrary = {
195+
NativeNestedLibrary: {
196+
NativeComponent: React.createClass({
197+
displayName: "HelloMessage",
198+
render: function render() {
199+
return React.createElement("div", null, "Hello ", this.props.name);
200+
}
201+
})
202+
}
203+
}
204+
}
205+
206+
expect(React.render_to_static_markup(
207+
React.create_element(NativeLibraryTestModule::NestedComponent, time_stamp: Time.now))).to eq('<div>Hello There</div>')
208+
end
209+
210+
# it "the library and components can begin with lower case letters" do
211+
# %x{
212+
# window.nativeLibrary = {
213+
# nativeComponent: React.createClass({
214+
# displayName: "HelloMessage",
215+
# render: function render() {
216+
# return React.createElement("div", null, "Hello ", this.props.name);
217+
# }
218+
# })
219+
# }
220+
# }
221+
# expect(React.render_to_static_markup(
222+
# React.create_element(NativeLibrary::NativeComponent, name: "There"))).to eq('<div>Hello There</div>')
223+
# end
224+
225+
it "will produce a sensible error if the component is not in the library" do
226+
%x{
227+
window.NativeLibrary = {
228+
NativeNestedLibrary: {
229+
}
230+
}
231+
}
232+
#expect do
233+
begin
234+
`debugger`
235+
x = React.render_to_static_markup(React.create_element(NativeLibraryTestModule::NestedComponent, time_stamp: Time.now))
236+
puts x
237+
rescue Exception => e
238+
`debugger`
239+
nil
240+
end
241+
#end.to raise_error("could not import a react component named: #{NativeLibrary.NativeNestedLibrary.NestedComponent}")
242+
243+
end
244+
245+
end
246+
end
9247
end
10248
end

0 commit comments

Comments
 (0)
This repository has been archived.