mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-03-29 00:38:18 +08:00
Add 'unimplemented view' stubs
This commit is contained in:
2
src/components/FlatList/index.js
Normal file
2
src/components/FlatList/index.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import UnimplementedView from '../UnimplementedView';
|
||||
export default UnimplementedView;
|
||||
2
src/components/Modal/index.js
Normal file
2
src/components/Modal/index.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import UnimplementedView from '../UnimplementedView';
|
||||
export default UnimplementedView;
|
||||
2
src/components/Picker/index.js
Normal file
2
src/components/Picker/index.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import UnimplementedView from '../UnimplementedView';
|
||||
export default UnimplementedView;
|
||||
2
src/components/RefreshControl/index.js
Normal file
2
src/components/RefreshControl/index.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import UnimplementedView from '../UnimplementedView';
|
||||
export default UnimplementedView;
|
||||
2
src/components/SectionList/index.js
Normal file
2
src/components/SectionList/index.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import UnimplementedView from '../UnimplementedView';
|
||||
export default UnimplementedView;
|
||||
2
src/components/Slider/index.js
Normal file
2
src/components/Slider/index.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import UnimplementedView from '../UnimplementedView';
|
||||
export default UnimplementedView;
|
||||
2
src/components/Touchable/TouchableNativeFeedback.js
Normal file
2
src/components/Touchable/TouchableNativeFeedback.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import UnimplementedView from '../UnimplementedView';
|
||||
export default UnimplementedView;
|
||||
49
src/components/UnimplementedView/index.js
Normal file
49
src/components/UnimplementedView/index.js
Normal file
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @providesModule UnimplementedView
|
||||
* @flow
|
||||
*/
|
||||
|
||||
import View from '../View';
|
||||
import { any, object } from 'prop-types';
|
||||
import React, { Component } from 'react';
|
||||
|
||||
/**
|
||||
* Common implementation for a simple stubbed view.
|
||||
*/
|
||||
class UnimplementedView extends Component {
|
||||
static propTypes = {
|
||||
children: any,
|
||||
style: object
|
||||
};
|
||||
|
||||
setNativeProps() {
|
||||
// Do nothing.
|
||||
// This method is required in order to use this view as a Touchable* child.
|
||||
// See ensureComponentIsNative.js for more info
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View style={[unimplementedViewStyles, this.props.style]}>
|
||||
{this.props.children}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const unimplementedViewStyles = process.env.NODE_ENV !== 'production'
|
||||
? {
|
||||
alignSelf: 'flex-start',
|
||||
borderColor: 'red',
|
||||
borderWidth: 1
|
||||
}
|
||||
: {};
|
||||
|
||||
export default UnimplementedView;
|
||||
2
src/components/VirtualizedList/index.js
Normal file
2
src/components/VirtualizedList/index.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import UnimplementedView from '../UnimplementedView';
|
||||
export default UnimplementedView;
|
||||
16
src/index.js
16
src/index.js
@@ -32,19 +32,27 @@ import {
|
||||
// components
|
||||
ActivityIndicator,
|
||||
Button,
|
||||
FlatList,
|
||||
Image,
|
||||
ListView,
|
||||
Modal,
|
||||
Picker,
|
||||
ProgressBar,
|
||||
RefreshControl,
|
||||
ScrollView,
|
||||
SectionList,
|
||||
Slider,
|
||||
StatusBar,
|
||||
Switch,
|
||||
Text,
|
||||
TextInput,
|
||||
Touchable,
|
||||
TouchableHighlight,
|
||||
TouchableNativeFeedback,
|
||||
TouchableOpacity,
|
||||
TouchableWithoutFeedback,
|
||||
View,
|
||||
VirtualizedList,
|
||||
|
||||
// propTypes
|
||||
ColorPropType,
|
||||
@@ -89,19 +97,27 @@ const ReactNative = {
|
||||
// components
|
||||
ActivityIndicator,
|
||||
Button,
|
||||
FlatList,
|
||||
Image,
|
||||
ListView,
|
||||
Modal,
|
||||
Picker,
|
||||
ProgressBar,
|
||||
RefreshControl,
|
||||
ScrollView,
|
||||
SectionList,
|
||||
Slider,
|
||||
StatusBar,
|
||||
Switch,
|
||||
Text,
|
||||
TextInput,
|
||||
Touchable,
|
||||
TouchableHighlight,
|
||||
TouchableNativeFeedback,
|
||||
TouchableOpacity,
|
||||
TouchableWithoutFeedback,
|
||||
View,
|
||||
VirtualizedList,
|
||||
|
||||
// propTypes
|
||||
ColorPropType,
|
||||
|
||||
@@ -27,21 +27,29 @@ export { default as Vibration } from './apis/Vibration';
|
||||
// components
|
||||
export { default as ActivityIndicator } from './components/ActivityIndicator';
|
||||
export { default as Button } from './components/Button';
|
||||
export { default as FlatList } from './components/FlatList';
|
||||
export { default as Image } from './components/Image';
|
||||
export { default as ListView } from './components/ListView';
|
||||
export { default as Modal } from './components/Modal';
|
||||
export { default as Picker } from './components/Picker';
|
||||
export { default as ProgressBar } from './components/ProgressBar';
|
||||
export { default as RefreshControl } from './components/RefreshControl';
|
||||
export { default as ScrollView } from './components/ScrollView';
|
||||
export { default as SectionList } from './components/SectionList';
|
||||
export { default as Slider } from './components/Slider';
|
||||
export { default as StatusBar } from './components/StatusBar';
|
||||
export { default as Switch } from './components/Switch';
|
||||
export { default as Text } from './components/Text';
|
||||
export { default as TextInput } from './components/TextInput';
|
||||
export { default as Touchable } from './components/Touchable/Touchable';
|
||||
export { default as TouchableHighlight } from './components/Touchable/TouchableHighlight';
|
||||
export { default as TouchableNativeFeedback } from './components/Touchable/TouchableNativeFeedback';
|
||||
export { default as TouchableOpacity } from './components/Touchable/TouchableOpacity';
|
||||
export {
|
||||
default as TouchableWithoutFeedback
|
||||
} from './components/Touchable/TouchableWithoutFeedback';
|
||||
export { default as View } from './components/View';
|
||||
export { default as VirtualizedList } from './components/VirtualizedList';
|
||||
|
||||
// propTypes
|
||||
export { default as ColorPropType } from './propTypes/ColorPropType';
|
||||
|
||||
Reference in New Issue
Block a user