Skip to content

Commit

Permalink
don't process too early, just don't set the function prop to true if …
Browse files Browse the repository at this point in the history
…we have a process function
  • Loading branch information
hannojg committed Jan 30, 2025
1 parent 12b2e7d commit 9e74020
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -295,14 +295,8 @@ function diffProperties(
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 {
const attributeConfigHasProcess = typeof attributeConfig === 'object' && typeof attributeConfig.process === 'function';
if (!attributeConfigHasProcess) {
// functions are converted to booleans as markers that the associated
// events should be sent from native.
nextProp = (true: any);
Expand Down

0 comments on commit 9e74020

Please sign in to comment.