Skip to content

Commit

Permalink
add missing onLayout prop typings (#1815)
Browse files Browse the repository at this point in the history
onLayout prop typings are missing. This PR simply adds missing onLayout prop to svg nodes.

Co-authored-by: Sergey Tshovrebov <sinxwal@gmail.com>
  • Loading branch information
WoLewicki and sinxwal committed Jul 26, 2022
1 parent 9c1a8b1 commit af68c93
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/elements/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { withoutXY } from '../lib/extract/extractProps';
import {
ClipProps,
CommonMaskProps,
NativeProps,
NumberProp,
ResponderProps,
TouchableProps,
Expand All @@ -18,7 +19,8 @@ export interface ImageProps
extends ResponderProps,
CommonMaskProps,
ClipProps,
TouchableProps {
TouchableProps,
NativeProps {
x?: NumberProp;
y?: NumberProp;
width?: NumberProp;
Expand Down
7 changes: 6 additions & 1 deletion src/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import * as ReactNative from "react-native";
import {
ColorValue,
GestureResponderEvent,
LayoutChangeEvent,
TransformsStyle,
} from "react-native";
export type NumberProp = string | number;
Expand Down Expand Up @@ -191,6 +192,9 @@ export interface CommonMarkerProps {
markerMid?: string;
markerEnd?: string;
}
export interface NativeProps {
onLayout?: (event: LayoutChangeEvent) => void;
}
export type CommonPathProps = { ... } & FillProps &
StrokeProps &
ClipProps &
Expand All @@ -200,7 +204,8 @@ export type CommonPathProps = { ... } & FillProps &
TouchableProps &
DefinitionProps &
CommonMarkerProps &
CommonMaskProps;
CommonMaskProps &
NativeProps;
export type CircleProps = {
cx?: NumberProp,
cy?: NumberProp,
Expand Down
7 changes: 6 additions & 1 deletion src/lib/extract/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ export interface CommonMarkerProps {
markerEnd?: string;
}

export interface NativeProps {
onLayout?: (event: LayoutChangeEvent) => void;
}

export interface CommonPathProps
extends FillProps,
StrokeProps,
Expand All @@ -242,7 +246,8 @@ export interface CommonPathProps
TouchableProps,
DefinitionProps,
CommonMarkerProps,
CommonMaskProps {}
CommonMaskProps,
NativeProps {}

export type ResponderInstanceProps = {
touchableHandleResponderMove?: (e: GestureResponderEvent) => void;
Expand Down

0 comments on commit af68c93

Please sign in to comment.