Skip to content

Adds hook for platform-specific View props #15175

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 2 commits 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
13 changes: 13 additions & 0 deletions Libraries/Components/View/PlatformViewPropTypes.android.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule PlatformViewPropTypes
* @flow
*/

module.export = {};
20 changes: 20 additions & 0 deletions Libraries/Components/View/PlatformViewPropTypes.ios.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule PlatformViewPropTypes
* @flow
*/

const Platform = require('Platform');

var TVViewPropTypes = {};
if (Platform.isTVOS) {
TVViewPropTypes = require('TVViewPropTypes');
}

module.exports = TVViewPropTypes;
9 changes: 2 additions & 7 deletions Libraries/Components/View/ViewPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'use strict';

const EdgeInsetsPropType = require('EdgeInsetsPropType');
const Platform = require('Platform');
const PlatformViewPropTypes = require('PlatformViewPropTypes');
const PropTypes = require('prop-types');
const StyleSheetPropType = require('StyleSheetPropType');
const ViewStylePropTypes = require('ViewStylePropTypes');
Expand All @@ -22,11 +22,6 @@ const {
AccessibilityTraits,
} = require('ViewAccessibility');

var TVViewPropTypes = {};
if (Platform.isTVOS) {
TVViewPropTypes = require('TVViewPropTypes');
}

import type {
AccessibilityComponentType,
AccessibilityTrait,
Expand Down Expand Up @@ -85,7 +80,7 @@ export type ViewProps = {
} & TVViewProps;

module.exports = {
...TVViewPropTypes,
...PlatformViewPropTypes,

/**
* When `true`, indicates that the view is an accessibility element. By default,
Expand Down