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
This commit is contained in:
Alex Kotliarskyi 2016-01-06 05:57:13 -08:00 committed by facebook-github-bot-7
parent cf350a69de
commit 28c0240361
1 changed files with 2 additions and 3 deletions

View File

@ -17,19 +17,18 @@ var Touchable = require('Touchable');
var TouchableWithoutFeedback = require('TouchableWithoutFeedback'); var TouchableWithoutFeedback = require('TouchableWithoutFeedback');
var UIManager = require('UIManager'); var UIManager = require('UIManager');
var createStrictShapeTypeChecker = require('createStrictShapeTypeChecker');
var ensurePositiveDelayProps = require('ensurePositiveDelayProps'); var ensurePositiveDelayProps = require('ensurePositiveDelayProps');
var onlyChild = require('onlyChild'); var onlyChild = require('onlyChild');
var processColor = require('processColor'); var processColor = require('processColor');
var requireNativeComponent = require('requireNativeComponent'); var requireNativeComponent = require('requireNativeComponent');
var rippleBackgroundPropType = createStrictShapeTypeChecker({ var rippleBackgroundPropType = PropTypes.shape({
type: React.PropTypes.oneOf(['RippleAndroid']), type: React.PropTypes.oneOf(['RippleAndroid']),
color: PropTypes.number, color: PropTypes.number,
borderless: PropTypes.bool, borderless: PropTypes.bool,
}); });
var themeAttributeBackgroundPropType = createStrictShapeTypeChecker({ var themeAttributeBackgroundPropType = PropTypes.shape({
type: React.PropTypes.oneOf(['ThemeAttrAndroid']), type: React.PropTypes.oneOf(['ThemeAttrAndroid']),
attribute: PropTypes.string.isRequired, attribute: PropTypes.string.isRequired,
}); });