Files
react-native/packages/react-native/Libraries/Events/CustomEvent.js
T
Jakub Piasecki bae8955000 Align press and scroll events with OSS (#49424)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49424

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69655561

fbshipit-source-id: c36036a2abb43dd75c41582f2a27e7f9d3509044
2025-02-19 03:43:07 -08:00

33 lines
806 B
JavaScript

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow strict-local
*/
// Make sure global Event is defined
import EventPolyfill from './EventPolyfill';
type CustomEvent$Options = $ReadOnly<{
bubbles?: boolean,
cancelable?: boolean,
composed?: boolean,
detail?: {...},
}>;
class CustomEvent extends EventPolyfill {
detail: ?{...};
constructor(typeArg: string, options: CustomEvent$Options) {
const {bubbles, cancelable, composed} = options;
super(typeArg, {bubbles, cancelable, composed});
this.detail = options.detail; // this would correspond to `NativeEvent` in NativeSyntheticEvent
}
}
export default CustomEvent;