Skip to content

Commit

Permalink
Fix 0.15 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Mar 25, 2016
1 parent d7bcd1b commit 08d9350
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
13 changes: 9 additions & 4 deletions src/renderers/native/ReactNative/ReactNativeBaseComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ ReactNativeBaseComponent.Mixin = {
return this;
},

construct: function(element) {
this._currentElement = element;
},

unmountComponent: function() {
deleteAllListeners(this._rootNodeID);
this.unmountChildren();
Expand Down Expand Up @@ -174,6 +170,15 @@ ReactNativeBaseComponent.Mixin = {
}
},

/**
* Currently this still uses IDs for reconciliation so this can return null.
*
* @return {null} Null.
*/
getNativeNode: function() {
return null;
},

/**
* @param {string} rootID Root ID of this subtree.
* @param {Transaction} transaction For creating/updating.
Expand Down
20 changes: 10 additions & 10 deletions src/renderers/native/ReactNative/ReactNativeDefaultInjection.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ var ReactElement = require('ReactElement');
var ReactComponentEnvironment = require('ReactComponentEnvironment');
var ReactDefaultBatchingStrategy = require('ReactDefaultBatchingStrategy');
var ReactEmptyComponent = require('ReactEmptyComponent');
var ReactInstanceHandles = require('ReactInstanceHandles');
var ReactNativeComponentEnvironment = require('ReactNativeComponentEnvironment');
var ReactNativeGlobalInteractionHandler = require('ReactNativeGlobalInteractionHandler');
var ReactNativeGlobalResponderHandler = require('ReactNativeGlobalResponderHandler');
var ReactNativeMount = require('ReactNativeMount');
var ReactNativeTextComponent = require('ReactNativeTextComponent');
var ReactNativeComponent = require('ReactNativeComponent');
var ReactSimpleEmptyComponent = require('ReactSimpleEmptyComponent');
var ReactUpdates = require('ReactUpdates');
var ResponderEventPlugin = require('ResponderEventPlugin');
var UniversalWorkerNodeHandle = require('UniversalWorkerNodeHandle');
Expand All @@ -50,7 +49,6 @@ function inject() {
* Inject module for resolving DOM hierarchy and plugin ordering.
*/
EventPluginHub.injection.injectEventPluginOrder(IOSDefaultEventPluginOrder);
EventPluginHub.injection.injectInstanceHandle(ReactInstanceHandles);

ResponderEventPlugin.injection.injectGlobalResponderHandler(
ReactNativeGlobalResponderHandler
Expand Down Expand Up @@ -81,17 +79,19 @@ function inject() {
ReactNativeComponentEnvironment
);

var EmptyComponent = () => {
var EmptyComponent = (instantiate) => {
// Can't import View at the top because it depends on React to make its composite
var View = require('View');
return ReactElement.createElement(View, {
collapsable: true,
style: { position: 'absolute' }
});
return new ReactSimpleEmptyComponent(
ReactElement.createElement(View, {
collapsable: true,
style: { position: 'absolute' }
}),
instantiate
);
};
ReactEmptyComponent.injection.injectEmptyComponent(EmptyComponent);

EventPluginUtils.injection.injectMount(ReactNativeMount);
ReactEmptyComponent.injection.injectEmptyComponentFactory(EmptyComponent);

ReactNativeComponent.injection.injectTextComponentClass(
ReactNativeTextComponent
Expand Down
3 changes: 2 additions & 1 deletion src/renderers/native/ReactNative/ReactNativeEventEmitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
'use strict';

var EventPluginHub = require('EventPluginHub');
var EventPluginRegistry = require('EventPluginRegistry');
var ReactEventEmitterMixin = require('ReactEventEmitterMixin');
var ReactNativeTagHandles = require('ReactNativeTagHandles');
var NodeHandle = require('NodeHandle');
Expand Down Expand Up @@ -91,7 +92,7 @@ var removeTouchesAtIndices = function(
*/
var ReactNativeEventEmitter = merge(ReactEventEmitterMixin, {

registrationNames: EventPluginHub.registrationNameModules,
registrationNames: EventPluginRegistry.registrationNameModules,

putListener: EventPluginHub.putListener,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var createReactNativeComponentClass = function(
): ReactClass<any> {
var Constructor = function(element) {
this._currentElement = element;
this._topLevelWrapper = null;

this._rootNodeID = null;
this._renderedChildren = null;
Expand Down

0 comments on commit 08d9350

Please sign in to comment.