diff --git a/packages/react-native-renderer/src/ReactNativeAttributePayloadFabric.js b/packages/react-native-renderer/src/ReactNativeAttributePayloadFabric.js index 5c812f1d9bfc5..7ecee8acb904b 100644 --- a/packages/react-native-renderer/src/ReactNativeAttributePayloadFabric.js +++ b/packages/react-native-renderer/src/ReactNativeAttributePayloadFabric.js @@ -294,23 +294,15 @@ function diffProperties( prevProp = prevProps[propKey]; nextProp = nextProps[propKey]; - if (typeof nextProp === 'function') { - if (typeof attributeConfig === 'object') { - // When the config for a function prop has a custom process method - // we don't assume its a regular event handler, but use the process method: - nextProp = attributeConfig.process(nextProp); - if (typeof prevProp === 'function') { - prevProp = attributeConfig.process(prevProp); - } - } else { - // functions are converted to booleans as markers that the associated - // events should be sent from native. - nextProp = (true: any); - // If nextProp is not a function, then don't bother changing prevProp - // since nextProp will win and go into the updatePayload regardless. - if (typeof prevProp === 'function') { - prevProp = (true: any); - } + const attributeConfigHasProcess = typeof attributeConfig === 'object' && typeof attributeConfig.process === 'function'; + if (typeof nextProp === 'function' && !attributeConfigHasProcess) { + // functions are converted to booleans as markers that the associated + // events should be sent from native. + nextProp = (true: any); + // If nextProp is not a function, then don't bother changing prevProp + // since nextProp will win and go into the updatePayload regardless. + if (typeof prevProp === 'function') { + prevProp = (true: any); } }