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:
Родитель
de1a72acae
Коммит
49b3b31d8e
|
@ -34,6 +34,7 @@ function getConstants(): Object {
|
||||||
function getViewManagerConfig(viewManagerName: string): any {
|
function getViewManagerConfig(viewManagerName: string): any {
|
||||||
if (
|
if (
|
||||||
viewManagerConfigs[viewManagerName] === undefined &&
|
viewManagerConfigs[viewManagerName] === undefined &&
|
||||||
|
global.nativeCallSyncHook && // If we're in the Chrome Debugger, let's not even try calling the sync method
|
||||||
NativeUIManager.getConstantsForViewManager
|
NativeUIManager.getConstantsForViewManager
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -21,7 +21,7 @@ function deprecatedPropType(
|
||||||
// Don't warn for native components.
|
// Don't warn for native components.
|
||||||
if (
|
if (
|
||||||
global.RN$Bridgeless !== true &&
|
global.RN$Bridgeless !== true &&
|
||||||
UIManager.hasViewManagerConfig(componentName) &&
|
!UIManager.hasViewManagerConfig(componentName) &&
|
||||||
props[propName] !== undefined
|
props[propName] !== undefined
|
||||||
) {
|
) {
|
||||||
console.warn(
|
console.warn(
|
||||||
|
|
Загрузка…
Ссылка в новой задаче