mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
dbe0d7d4b5
Summary: The [PlatformColor PR](https://github.com/facebook/react-native/pull/27908) is currently open to implement the [PlatformColor proposal](react-native-community/discussions-and-proposals#126). When that PR was imported into Facebooks internal builds it was found that the change to the `processColor()` function to return an opaque type or `number` instead of just `number` breaks internal components. This PR is a simplification of the PlatformColor PR only changing the return type of `processColor()` from `?number` to `?number | NativeColorType` where `NativeColorType` is just an empty but opaque type. This will allow changes to be made to these internal components but with less risk than the larger PR. ## Changelog [General] [Changed] - Add NativeColorType opaque type to normalizeColor() ahead of PlatformColor PR Pull Request resolved: https://github.com/facebook/react-native/pull/28040 Test Plan: Flow checks, Jest test, iOS unit tests, iOS integration tests, and manual testing performed on RNTester for iOS and Android. Differential Revision: D19860205 Pulled By: TheSavior fbshipit-source-id: 799662c6621d3974158b375ccccfa136982c43b4
23 lines
532 B
JavaScript
23 lines
532 B
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
* @flow strict-local
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
const processColor = require('./processColor');
|
|
import type {ProcessedColorValue} from './processColor';
|
|
|
|
function processColorArray(
|
|
colors: ?Array<string>,
|
|
): ?Array<ProcessedColorValue> {
|
|
return colors == null ? null : colors.map(processColor);
|
|
}
|
|
|
|
module.exports = processColorArray;
|