Skip to content

Commit

Permalink
Make UnimplementedView invisible in prod
Browse files Browse the repository at this point in the history
Reviewed By: yungsters

Differential Revision: D5188697

fbshipit-source-id: 13bae1c99876d81204a89d72227bed4774be1664
  • Loading branch information
sahrens authored and facebook-github-bot committed Jun 6, 2017
1 parent d78fb45 commit 23e2771
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions Libraries/Components/UnimplementedViews/UnimplementedView.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,27 @@
*
* @providesModule UnimplementedView
* @flow
* @format
*/
'use strict';

var React = require('React');
var StyleSheet = require('StyleSheet');
const React = require('React');
const StyleSheet = require('StyleSheet');

/**
* Common implementation for a simple stubbed view. Simply applies the view's styles to the inner
* View component and renders its children.
*/
class UnimplementedView extends React.Component {
setNativeProps = () => {
setNativeProps() {
// Do nothing.
// This method is required in order to use this view as a Touchable* child.
// See ensureComponentIsNative.js for more info
};
}

render() {
// Workaround require cycle from requireNativeComponent
var View = require('View');
const View = require('View');
return (
<View style={[styles.unimplementedView, this.props.style]}>
{this.props.children}
Expand All @@ -36,12 +37,14 @@ class UnimplementedView extends React.Component {
}
}

var styles = StyleSheet.create({
unimplementedView: {
borderWidth: 1,
borderColor: 'red',
alignSelf: 'flex-start',
}
const styles = StyleSheet.create({
unimplementedView: __DEV__
? {
alignSelf: 'flex-start',
borderColor: 'red',
borderWidth: 1,
}
: {},
});

module.exports = UnimplementedView;

0 comments on commit 23e2771

Please sign in to comment.