Skip to content

Commit

Permalink
Fix background warning in TouchableNativeFeedback
Browse files Browse the repository at this point in the history
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 #5132

Reviewed By: svcscm

Differential Revision: D2804478

Pulled By: mkonicek

fb-gh-sync-id: 32ce964047bddd9d92c214baaff5422dbcfd7e90
  • Loading branch information
frantic authored and facebook-github-bot-7 committed Jan 6, 2016
1 parent cf350a6 commit 28c0240
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down

3 comments on commit 28c0240

@Ehesp
Copy link
Contributor

@Ehesp Ehesp commented on 28c0240 Jan 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this help with the Ripple not working in Android 6.*?

@frantic
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please post a link to the issue you are referring to?

@Ehesp
Copy link
Contributor

@Ehesp Ehesp commented on 28c0240 Jan 25, 2016 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.