27
});
28
29
it('should be able to create and render a native component', () => {
30
- var View = createReactNativeComponentClass({
30
+ var View = createReactNativeComponentClass('View', () => ({
31
validAttributes: {foo: true},
32
uiViewClassName: 'View',
33
- });
33
+ }));
34
35
ReactNative.render(<View foo="test" />, 1);
36
expect(UIManager.createView).toBeCalled();
40
});
41
42
it('should be able to create and update a native component', () => {
43
- var View = createReactNativeComponentClass({
43
+ var View = createReactNativeComponentClass('View', () => ({
44
validAttributes: {foo: true},
45
uiViewClassName: 'View',
46
- });
46
+ }));
47
48
ReactNative.render(<View foo="foo" />, 11);
49
61
});
62
63
it('should not call UIManager.updateView after render for properties that have not changed', () => {
64
- const Text = createReactNativeComponentClass({
64
+ const Text = createReactNativeComponentClass('Text', () => ({
65
validAttributes: {foo: true},
66
uiViewClassName: 'Text',
67
- });
67
+ }));
68
69
ReactNative.render(<Text foo="a">1</Text>, 11);
70
expect(UIManager.updateView).not.toBeCalled();
87
});
88
89
it('should not call UIManager.updateView from setNativeProps for properties that have not changed', () => {
90
- const View = createReactNativeComponentClass({
90
+ const View = createReactNativeComponentClass('View', () => ({
91
validAttributes: {foo: true},
92
uiViewClassName: 'View',
93
- });
93
+ }));
94
95
class Subclass extends ReactNative.NativeComponent {
96
render() {
122
});
123
124
it('returns the correct instance and calls it in the callback', () => {
125
- var View = createReactNativeComponentClass({
125
+ var View = createReactNativeComponentClass('View', () => ({
126
validAttributes: {foo: true},
127
uiViewClassName: 'View',
128
- });
128
+ }));
129
130
var a;
131
var b;
143
});
144
145
it('renders and reorders children', () => {
146
- var View = createReactNativeComponentClass({
146
+ var View = createReactNativeComponentClass('View', () => ({
147
validAttributes: {title: true},
148
uiViewClassName: 'View',
149
- });
149
+ }));
150
151
class Component extends React.Component {
152
render() {