Move NativeMethodsDecorator

This commit is contained in:
Nicolas Gallagher
2016-03-14 23:25:58 -07:00
parent 9a8a9ad209
commit e26edfb9ea
9 changed files with 28 additions and 15 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
import { NativeMethodsDecorator } from '../../modules/NativeMethodsMixin'
import NativeMethodsDecorator from '../../modules/NativeMethodsDecorator'
import React, { Component, PropTypes } from 'react'
import ReactDOM from 'react-dom'
import StyleSheet from '../../apis/StyleSheet'
+1 -1
View File
@@ -1,4 +1,4 @@
import { NativeMethodsDecorator } from '../../modules/NativeMethodsMixin'
import NativeMethodsDecorator from '../../modules/NativeMethodsDecorator'
import React, { Component, PropTypes } from 'react'
import StyleSheet from '../../apis/StyleSheet'
+1 -1
View File
@@ -1,5 +1,5 @@
/* global window */
import { NativeMethodsDecorator } from '../../modules/NativeMethodsMixin'
import NativeMethodsDecorator from '../../modules/NativeMethodsDecorator'
import resolveAssetSource from './resolveAssetSource'
import CoreComponent from '../CoreComponent'
import ImageResizeMode from './ImageResizeMode'
+1 -1
View File
@@ -1,4 +1,4 @@
import { NativeMethodsDecorator } from '../../modules/NativeMethodsMixin'
import NativeMethodsDecorator from '../../modules/NativeMethodsDecorator'
import React, { Component, PropTypes } from 'react'
import ScrollView from '../ScrollView'
+1 -1
View File
@@ -1,4 +1,4 @@
import { NativeMethodsDecorator } from '../../modules/NativeMethodsMixin'
import NativeMethodsDecorator from '../../modules/NativeMethodsDecorator'
import CoreComponent from '../CoreComponent'
import React, { Component, PropTypes } from 'react'
import StyleSheet from '../../apis/StyleSheet'
+1 -1
View File
@@ -1,4 +1,4 @@
import { NativeMethodsDecorator } from '../../modules/NativeMethodsMixin'
import NativeMethodsDecorator from '../../modules/NativeMethodsDecorator'
import CoreComponent from '../CoreComponent'
import React, { Component, PropTypes } from 'react'
import ReactDOM from 'react-dom'
+2 -1
View File
@@ -1,4 +1,5 @@
import { NativeMethodsDecorator } from '../../modules/NativeMethodsMixin'
import NativeMethodsDecorator from '../../modules/NativeMethodsDecorator'
import normalizeNativeEvent from '../../apis/PanResponder/normalizeNativeEvent'
import CoreComponent from '../CoreComponent'
import React, { Component, PropTypes } from 'react'
import StyleSheet from '../../apis/StyleSheet'
@@ -0,0 +1,19 @@
/**
* Copyright (c) 2015-present, Nicolas Gallagher.
* All rights reserved.
*
* @flow
*/
import NativeMethodsMixin from '../NativeMethodsMixin'
const NativeMethodsDecorator = (Component) => {
Object.keys(NativeMethodsMixin).forEach((method) => {
if (!Component.prototype[method]) {
Component.prototype[method] = NativeMethodsMixin[method]
}
})
return Component
}
module.exports = NativeMethodsDecorator
+1 -8
View File
@@ -90,11 +90,4 @@ const mountSafeCallback = (context: Component, callback: ?Function) => () => {
return callback.apply(context, arguments)
}
export const NativeMethodsDecorator = (Component) => {
Object.keys(NativeMethodsMixin).forEach((method) => {
Component.prototype[method] = NativeMethodsMixin[method]
})
return Component
}
export default NativeMethodsMixin
module.exports = NativeMethodsMixin