Skip to content

Commit 9e74020

Browse files
committed
don't process too early, just don't set the function prop to true if we have a process function
1 parent 12b2e7d commit 9e74020

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

packages/react-native-renderer/src/ReactNativeAttributePayloadFabric.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -295,14 +295,8 @@ function diffProperties(
295295
nextProp = nextProps[propKey];
296296

297297
if (typeof nextProp === 'function') {
298-
if (typeof attributeConfig === 'object') {
299-
// When the config for a function prop has a custom process method
300-
// we don't assume its a regular event handler, but use the process method:
301-
nextProp = attributeConfig.process(nextProp);
302-
if (typeof prevProp === 'function') {
303-
prevProp = attributeConfig.process(prevProp);
304-
}
305-
} else {
298+
const attributeConfigHasProcess = typeof attributeConfig === 'object' && typeof attributeConfig.process === 'function';
299+
if (!attributeConfigHasProcess) {
306300
// functions are converted to booleans as markers that the associated
307301
// events should be sent from native.
308302
nextProp = (true: any);

0 commit comments

Comments
 (0)