mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Prettier React Native Libraries
Reviewed By: sahrens Differential Revision: D7961488 fbshipit-source-id: 05f9b8b0b91ae77f9040a5321ccc18f7c3c1ce9a
This commit is contained in:
committed by
Facebook Github Bot
parent
1e2de71290
commit
d01ab66b47
@@ -4,8 +4,10 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const React = require('React');
|
||||
@@ -132,16 +134,16 @@ class ViewPagerAndroid extends React.Component<{
|
||||
]),
|
||||
|
||||
/**
|
||||
* When false, the content does not scroll.
|
||||
* The default value is true.
|
||||
*/
|
||||
* When false, the content does not scroll.
|
||||
* The default value is true.
|
||||
*/
|
||||
scrollEnabled: PropTypes.bool,
|
||||
|
||||
/**
|
||||
* Whether enable showing peekFraction or not. If this is true, the preview of
|
||||
* last and next page will show in current screen. Defaults to false.
|
||||
*/
|
||||
peekEnabled: PropTypes.bool,
|
||||
peekEnabled: PropTypes.bool,
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
@@ -164,22 +166,30 @@ class ViewPagerAndroid extends React.Component<{
|
||||
}
|
||||
const newProps = {
|
||||
...child.props,
|
||||
style: [child.props.style, {
|
||||
position: 'absolute',
|
||||
left: 0,
|
||||
top: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
width: undefined,
|
||||
height: undefined,
|
||||
}],
|
||||
style: [
|
||||
child.props.style,
|
||||
{
|
||||
position: 'absolute',
|
||||
left: 0,
|
||||
top: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
width: undefined,
|
||||
height: undefined,
|
||||
},
|
||||
],
|
||||
collapsable: false,
|
||||
};
|
||||
if (child.type &&
|
||||
child.type.displayName &&
|
||||
(child.type.displayName !== 'RCTView') &&
|
||||
(child.type.displayName !== 'View')) {
|
||||
console.warn('Each ViewPager child must be a <View>. Was ' + child.type.displayName);
|
||||
if (
|
||||
child.type &&
|
||||
child.type.displayName &&
|
||||
child.type.displayName !== 'RCTView' &&
|
||||
child.type.displayName !== 'View'
|
||||
) {
|
||||
console.warn(
|
||||
'Each ViewPager child must be a <View>. Was ' +
|
||||
child.type.displayName,
|
||||
);
|
||||
}
|
||||
return React.createElement(child.type, newProps);
|
||||
});
|
||||
@@ -245,6 +255,9 @@ class ViewPagerAndroid extends React.Component<{
|
||||
}
|
||||
}
|
||||
|
||||
const NativeAndroidViewPager = requireNativeComponent('AndroidViewPager', ViewPagerAndroid);
|
||||
const NativeAndroidViewPager = requireNativeComponent(
|
||||
'AndroidViewPager',
|
||||
ViewPagerAndroid,
|
||||
);
|
||||
|
||||
module.exports = ViewPagerAndroid;
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = require('UnimplementedView');
|
||||
|
||||
Reference in New Issue
Block a user