Skip to content

Add platform hook for View style props #18100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Libraries/Components/View/PlatformViewStylePropTypes.android.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule PlatformViewStylePropTypes
* @flow
*/

module.export = {
/**
* (Android-only) Sets the elevation of a view, using Android's underlying
* [elevation API](https://developer.android.com/training/material/shadows-clipping.html#Elevation).
* This adds a drop shadow to the item and affects z-order for overlapping views.
* Only supported on Android 5.0+, has no effect on earlier versions.
* @platform android
*/
elevation: ReactPropTypes.number,
};
11 changes: 11 additions & 0 deletions Libraries/Components/View/PlatformViewStylePropTypes.ios.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule PlatformViewStylePropTypes
* @flow
*/

module.export = {};
10 changes: 2 additions & 8 deletions Libraries/Components/View/ViewStylePropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
var ColorPropType = require('ColorPropType');
var LayoutPropTypes = require('LayoutPropTypes');
var ReactPropTypes = require('prop-types');
var PlatformViewStylePropTypes = require('PlatformViewStylePropTypes');
var ShadowPropTypesIOS = require('ShadowPropTypesIOS');
var TransformPropTypes = require('TransformPropTypes');

Expand All @@ -20,6 +21,7 @@ var TransformPropTypes = require('TransformPropTypes');
*/
var ViewStylePropTypes = {
...LayoutPropTypes,
...PlatformViewStylePropTypes,
...ShadowPropTypesIOS,
...TransformPropTypes,
backfaceVisibility: ReactPropTypes.oneOf(['visible', 'hidden']),
Expand Down Expand Up @@ -47,14 +49,6 @@ var ViewStylePropTypes = {
borderBottomWidth: ReactPropTypes.number,
borderLeftWidth: ReactPropTypes.number,
opacity: ReactPropTypes.number,
/**
* (Android-only) Sets the elevation of a view, using Android's underlying
* [elevation API](https://developer.android.com/training/material/shadows-clipping.html#Elevation).
* This adds a drop shadow to the item and affects z-order for overlapping views.
* Only supported on Android 5.0+, has no effect on earlier versions.
* @platform android
*/
elevation: ReactPropTypes.number,
};

module.exports = ViewStylePropTypes;