Skip to content

Commit

Permalink
pass all args in to event listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaGross committed Mar 2, 2022
1 parent 5045281 commit 15fc32a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react-native-renderer/src/ReactNativeGetListeners.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export default function getListeners(
// all imperative event listeners in a function to unwrap the SyntheticEvent
// and pass them an Event.
// When this API is more stable and used more frequently, we can revisit.
const listenerFnWrapper = function(syntheticEvent) {
const listenerFnWrapper = function(syntheticEvent, ...args) {
const eventInst = new CustomEvent(mangledImperativeRegistrationName, {
detail: syntheticEvent.nativeEvent,
});
Expand All @@ -127,7 +127,7 @@ export default function getListeners(
// $FlowFixMe
eventInst.setSyntheticEvent(syntheticEvent);

listenerObj.listener(eventInst);
listenerObj.listener(eventInst, ...args);
};

// Only call once?
Expand Down

0 comments on commit 15fc32a

Please sign in to comment.