Skip to content

fix array type parsing in DynamicEventPayload::extractValue#53689

Closed
zeyap wants to merge 1 commit into
facebook:mainfrom
zeyap:export-D82050538
Closed

fix array type parsing in DynamicEventPayload::extractValue#53689
zeyap wants to merge 1 commit into
facebook:mainfrom
zeyap:export-D82050538

Conversation

@zeyap
Copy link
Copy Markdown
Contributor

@zeyap zeyap commented Sep 9, 2025

Summary:

Changelog:

[General] [Fixed] - fix array type parsing in DynamicEventPayload::extractValue

When unwrapping event mapping like e.nativeEvent.touches[0].locationX e.g. for Animated.event like below,

onTouchMove={Animated.event(
  [
    {
      nativeEvent: {
        touches: {
          0: {locationX: animatedValue},
        },
      },
    },
  ],
  {useNativeDriver: true},
)}

here it'll throw exception terminating due to uncaught exception of type folly::TypeError: TypeError: expected dynamic type 'object', but had type 'array' when getting into folly dynamic array, because array index in the event path is string instead of integer

Differential Revision: D82050538

Summary:
## Changelog:

[General] [Fixed] - fix array type parsing in DynamicEventPayload::extractValue

When unwrapping event mapping like `e.nativeEvent.touches[0].locationX` e.g. for Animated.event like below, 

```
onTouchMove={Animated.event(
  [
    {
      nativeEvent: {
        touches: {
          0: {locationX: animatedValue},
        },
      },
    },
  ],
  {useNativeDriver: true},
)}
```
here it'll throw exception `terminating due to uncaught exception of type folly::TypeError: TypeError: expected dynamic type 'object', but had type 'array'` when getting into folly dynamic array, because array index in the event path is string instead of integer

Differential Revision: D82050538
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 9, 2025
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D82050538

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @zeyap in cf5040b

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Sep 10, 2025
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Sep 10, 2025
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in cf5040b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants