From 28c0240361de2ce88f69822c3a8400f0edafe7a9 Mon Sep 17 00:00:00 2001 From: Alex Kotliarskyi Date: Wed, 6 Jan 2016 05:57:13 -0800 Subject: [PATCH] Fix `background` warning in TouchableNativeFeedback Summary: The problem: no matter what value `background` prop has, it always triggers a warning ![screen shot 2016-01-05 at 1 20 35 pm](https://cloud.githubusercontent.com/assets/192222/12128053/c0a8754a-b3af-11e5-92c6-921e2e0c7cc4.png) Looks like this happens because we use `createStrictShapeTypeChecker` prop types inside `PropTypes.oneOfType` instead of `PropTypes.shape`. Closes https://github.com/facebook/react-native/pull/5132 Reviewed By: svcscm Differential Revision: D2804478 Pulled By: mkonicek fb-gh-sync-id: 32ce964047bddd9d92c214baaff5422dbcfd7e90 --- .../Components/Touchable/TouchableNativeFeedback.android.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Libraries/Components/Touchable/TouchableNativeFeedback.android.js b/Libraries/Components/Touchable/TouchableNativeFeedback.android.js index bc875eda5..240b2482a 100644 --- a/Libraries/Components/Touchable/TouchableNativeFeedback.android.js +++ b/Libraries/Components/Touchable/TouchableNativeFeedback.android.js @@ -17,19 +17,18 @@ var Touchable = require('Touchable'); var TouchableWithoutFeedback = require('TouchableWithoutFeedback'); var UIManager = require('UIManager'); -var createStrictShapeTypeChecker = require('createStrictShapeTypeChecker'); var ensurePositiveDelayProps = require('ensurePositiveDelayProps'); var onlyChild = require('onlyChild'); var processColor = require('processColor'); var requireNativeComponent = require('requireNativeComponent'); -var rippleBackgroundPropType = createStrictShapeTypeChecker({ +var rippleBackgroundPropType = PropTypes.shape({ type: React.PropTypes.oneOf(['RippleAndroid']), color: PropTypes.number, borderless: PropTypes.bool, }); -var themeAttributeBackgroundPropType = createStrictShapeTypeChecker({ +var themeAttributeBackgroundPropType = PropTypes.shape({ type: React.PropTypes.oneOf(['ThemeAttrAndroid']), attribute: PropTypes.string.isRequired, });