Fix errors in ReactNativeMount (#8223)
Ben Alpert committed
Nov 7, 2016 at 11:42 UTC
84c57ddc6d0aa0d6569c40c073cfdef0b8dd675e
3 files changed
+4
-3
scripts/fiber/tests-passing.txt
+1
-1
@@ -746,7 +746,7 @@ src/renderers/native/__tests__/ReactNativeEvents-test.js
746
src/renderers/native/__tests__/ReactNativeMount-test.js
747
* should be able to create and render a native component
748
* should be able to create and update a native component
749
-* should be able to create and update a native component
749
+* returns the correct instance and calls it in the callback
750
751
src/renderers/shared/__tests__/ReactDebugTool-test.js
752
* should add and remove hooks
src/renderers/native/ReactNativeMount.js
+2
-1
@@ -135,8 +135,9 @@ var ReactNativeMount = {
135
ReactNativeMount._instancesByContainerID[containerTag] = instance;
136
137
if (callback) {
138
+ var nonNullCallback = callback;
139
instance._pendingCallbacks = [function() {
139
- callback.call(instance._renderedComponent.getPublicInstance());
140
+ nonNullCallback.call(instance._renderedComponent.getPublicInstance());
141
}];
142
}
143
src/renderers/native/__tests__/ReactNativeMount-test.js
+1
-1
@@ -58,7 +58,7 @@ describe('ReactNative', () => {
58
expect(UIManager.updateView).toBeCalledWith(3, 'View', { foo: 'bar' });
59
});
60
61
- it('should be able to create and update a native component', () => {
61
+ it('returns the correct instance and calls it in the callback', () => {
62
var View = createReactNativeComponentClass({
63
validAttributes: { foo: true },
64
uiViewClassName: 'View',