mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: - Fix the StaticViewConfig violations for RCTView Changelog: [Internal] Reviewed By: yungsters Differential Revision: D32187835 fbshipit-source-id: c8c926817a9245b1e8671e5a2e8965ab7ffecace
28 lines
711 B
JavaScript
28 lines
711 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.
|
|
*
|
|
* @flow strict
|
|
* @format
|
|
*/
|
|
|
|
const ignoredViewConfigProps = new WeakSet<{...}>();
|
|
|
|
/**
|
|
* Decorates ViewConfig values that are dynamically injected by the library,
|
|
* react-native-gesture-handler. (T45765076)
|
|
*/
|
|
export function DynamicallyInjectedByGestureHandler<T: {...}>(object: T): T {
|
|
ignoredViewConfigProps.add(object);
|
|
return object;
|
|
}
|
|
|
|
export function isIgnored(value: mixed): boolean {
|
|
if (typeof value === 'object' && value != null) {
|
|
return ignoredViewConfigProps.has(value);
|
|
}
|
|
return false;
|
|
}
|