mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix regression with NativeSyntheticEvent and add test. (#38600)
Summary: With moving the TypeScript declarations into the repo, the NativeSyntheticEvent type was copied incorrectly from DefinitelyTyped. This was the old one: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-native/v0.70/index.d.ts#L355 ## Changelog: [GENERAL] [FIXED] - Correct the NativeSyntheticEvent type Pull Request resolved: https://github.com/facebook/react-native/pull/38600 Test Plan: Added a test and ran `yarn test-typescript` Reviewed By: NickGerleman Differential Revision: D47739191 Pulled By: lunaleaps fbshipit-source-id: 0c8b51a62f589a716121e9bfa8ce7e6103f37f6b
This commit is contained in:
committed by
Facebook GitHub Bot
parent
aa474847ec
commit
fedad15a69
@@ -8,7 +8,6 @@
|
||||
*/
|
||||
|
||||
import type * as React from 'react';
|
||||
import {NodeHandle} from '../ReactNative/RendererProxy';
|
||||
import {HostComponent} from '../../types/public/ReactNativeTypes';
|
||||
|
||||
export interface LayoutRectangle {
|
||||
@@ -42,7 +41,11 @@ export interface TextLayoutEventData extends TargetedEvent {
|
||||
|
||||
// Similar to React.SyntheticEvent except for nativeEvent
|
||||
export interface NativeSyntheticEvent<T>
|
||||
extends React.BaseSyntheticEvent<T, NodeHandle, NodeHandle> {}
|
||||
extends React.BaseSyntheticEvent<
|
||||
T,
|
||||
React.ElementRef<HostComponent<unknown>>,
|
||||
React.ElementRef<HostComponent<unknown>>
|
||||
> {}
|
||||
|
||||
export interface NativeTouchEvent {
|
||||
/**
|
||||
|
||||
@@ -386,6 +386,7 @@ const testNativeSyntheticEvent = <T extends {}>(
|
||||
e.isTrusted;
|
||||
e.nativeEvent;
|
||||
e.target;
|
||||
e.target.measure(() => {});
|
||||
e.timeStamp;
|
||||
e.type;
|
||||
e.nativeEvent;
|
||||
|
||||
Reference in New Issue
Block a user