Native component check in deprecatedPropType was inverted (#31164)

Summary:
While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that e68cf7cee9 appears to have accidently inverted the logic to avoid checking native components.

`!UIManager.getViewManagerConfig(componentName)`
become
`UIManager.hasViewManagerConfig(componentName)`
losing the !

Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging.

## Changelog

[Internal] [Fixed] - Restored the previous logic of deprecatedPropType

Pull Request resolved: https://github.com/facebook/react-native/pull/31164

Test Plan:
Change tested and being submitted in react-native-windows:
https://github.com/microsoft/react-native-windows/pull/7397

Reviewed By: hramos

Differential Revision: D30624302

Pulled By: fkgozali

fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f
This commit is contained in:
Andrew Coates 2021-08-30 18:02:02 -07:00 коммит произвёл Facebook GitHub Bot
Родитель de1a72acae
Коммит 49b3b31d8e
2 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -34,6 +34,7 @@ function getConstants(): Object {
function getViewManagerConfig(viewManagerName: string): any {
if (
viewManagerConfigs[viewManagerName] === undefined &&
global.nativeCallSyncHook && // If we're in the Chrome Debugger, let's not even try calling the sync method
NativeUIManager.getConstantsForViewManager
) {
try {

Просмотреть файл

@ -21,7 +21,7 @@ function deprecatedPropType(
// Don't warn for native components.
if (
global.RN$Bridgeless !== true &&
UIManager.hasViewManagerConfig(componentName) &&
!UIManager.hasViewManagerConfig(componentName) &&
props[propName] !== undefined
) {
console.warn(