mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
update flowification of react-native
Reviewed By: frantic, gabelevi Differential Revision: D3436342 fbshipit-source-id: 7630eac4601d0768f57dc9fc945595039067eceb
This commit is contained in:
committed by
Facebook Github Bot 9
parent
92d6632d7a
commit
b4a4c71a68
@@ -16,14 +16,31 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
// Export ReactNative, plus some native additions.
|
||||
// Export some ReactNative properties, plus native additions.
|
||||
//
|
||||
// The use of Object.create/assign is to work around a Flow bug (#6560135).
|
||||
// Once that is fixed, change this back to
|
||||
|
||||
// Our ReactNative.js has had its types stripped, so here we
|
||||
// need to enumerate and type the properties we need access to.
|
||||
//
|
||||
// var ReactNative = {...require('React'), /* additions */}
|
||||
//
|
||||
var ReactNative = Object.assign(Object.create(require('ReactNative')), {
|
||||
var ReactNativeInternal = (require('ReactNative'): {
|
||||
// render
|
||||
render: (
|
||||
element: ReactElement<any>,
|
||||
mountInto: number,
|
||||
callback?: ?(() => void)
|
||||
) => ?ReactComponent<any, any, any>,
|
||||
// findNodeHandle
|
||||
findNodeHandle: (componentOrHandle: any) => ?number,
|
||||
// NativeMethodsMixin
|
||||
NativeMethodsMixin: Object
|
||||
});
|
||||
|
||||
// export
|
||||
var ReactNative = {
|
||||
// from ReactNative internal
|
||||
findNodeHandle: ReactNativeInternal.findNodeHandle,
|
||||
render: ReactNativeInternal.render,
|
||||
NativeMethodsMixin: ReactNativeInternal.NativeMethodsMixin,
|
||||
// Components
|
||||
ActivityIndicator: require('ActivityIndicator'),
|
||||
ActivityIndicatorIOS: require('ActivityIndicatorIOS'),
|
||||
@@ -118,6 +135,6 @@ var ReactNative = Object.assign(Object.create(require('ReactNative')), {
|
||||
ColorPropType: require('ColorPropType'),
|
||||
EdgeInsetsPropType: require('EdgeInsetsPropType'),
|
||||
PointPropType: require('PointPropType'),
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = ReactNative;
|
||||
|
||||
Reference in New Issue
Block a user