2015-04-17 00:14:11 +00:00
|
|
|
/**
|
2017-05-13 00:32:17 +00:00
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
*
|
2018-02-17 02:24:55 +00:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2015-04-17 00:14:11 +00:00
|
|
|
*
|
|
|
|
* @providesModule UnimplementedView
|
2017-05-13 00:32:17 +00:00
|
|
|
* @flow
|
2017-06-06 16:38:32 +00:00
|
|
|
* @format
|
2015-04-17 00:14:11 +00:00
|
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
|
2017-06-06 16:38:32 +00:00
|
|
|
const React = require('React');
|
|
|
|
const StyleSheet = require('StyleSheet');
|
2015-04-17 00:14:11 +00:00
|
|
|
|
2017-05-13 00:32:17 +00:00
|
|
|
/**
|
|
|
|
* Common implementation for a simple stubbed view. Simply applies the view's styles to the inner
|
|
|
|
* View component and renders its children.
|
|
|
|
*/
|
2017-08-18 01:36:54 +00:00
|
|
|
class UnimplementedView extends React.Component<$FlowFixMeProps> {
|
2017-06-06 16:38:32 +00:00
|
|
|
setNativeProps() {
|
2015-04-17 00:14:11 +00:00
|
|
|
// Do nothing.
|
|
|
|
// This method is required in order to use this view as a Touchable* child.
|
|
|
|
// See ensureComponentIsNative.js for more info
|
2017-06-06 16:38:32 +00:00
|
|
|
}
|
2016-07-26 08:00:02 +00:00
|
|
|
|
|
|
|
render() {
|
2015-11-23 21:02:05 +00:00
|
|
|
// Workaround require cycle from requireNativeComponent
|
2017-06-06 16:38:32 +00:00
|
|
|
const View = require('View');
|
2015-04-17 00:14:11 +00:00
|
|
|
return (
|
|
|
|
<View style={[styles.unimplementedView, this.props.style]}>
|
|
|
|
{this.props.children}
|
|
|
|
</View>
|
|
|
|
);
|
2016-07-26 08:00:02 +00:00
|
|
|
}
|
|
|
|
}
|
2015-04-17 00:14:11 +00:00
|
|
|
|
2017-06-06 16:38:32 +00:00
|
|
|
const styles = StyleSheet.create({
|
|
|
|
unimplementedView: __DEV__
|
|
|
|
? {
|
|
|
|
alignSelf: 'flex-start',
|
|
|
|
borderColor: 'red',
|
|
|
|
borderWidth: 1,
|
|
|
|
}
|
|
|
|
: {},
|
2015-04-17 00:14:11 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = UnimplementedView;
|