mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
RN: Export ImageLoadEvent Type
Summary: Exports the `ImageLoadEvent` type so that components passing through the `onLoad` callback can be properly typed. Reviewed By: TheSavior Differential Revision: D10481050 fbshipit-source-id: f0a48163c6221087b0f9869c033c653316471af9
This commit is contained in:
committed by
Facebook Github Bot
parent
b002df945b
commit
b51a1d5791
@@ -17,16 +17,14 @@ import type {ViewStyleProp, ImageStyleProp} from 'StyleSheet';
|
||||
import type {DimensionValue} from 'StyleSheetTypes';
|
||||
import type {ViewProps} from 'ViewPropTypes';
|
||||
|
||||
type OnLoadEvent = SyntheticEvent<
|
||||
export type ImageLoadEvent = SyntheticEvent<
|
||||
$ReadOnly<{|
|
||||
// Only on Android
|
||||
uri?: string,
|
||||
|
||||
source: $ReadOnly<{|
|
||||
width: number,
|
||||
height: number,
|
||||
url: string,
|
||||
|}>,
|
||||
uri?: string, // Only on Android
|
||||
|}>,
|
||||
>;
|
||||
|
||||
@@ -112,7 +110,7 @@ export type ImageProps = {|
|
||||
*
|
||||
* See https://facebook.github.io/react-native/docs/image.html#onload
|
||||
*/
|
||||
onLoad?: ?(event: OnLoadEvent) => void,
|
||||
onLoad?: ?(event: ImageLoadEvent) => void,
|
||||
|
||||
/**
|
||||
* Invoked when load either succeeds or fails.
|
||||
|
||||
Reference in New Issue
Block a user