File tree Expand file tree Collapse file tree 4 files changed +19
-5
lines changed
packages/react-native-lightning/src/exports Expand file tree Collapse file tree 4 files changed +19
-5
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @plexinc/react-native-lightning " : patch
3
+ ---
4
+
5
+ Update some component typings
Original file line number Diff line number Diff line change @@ -5,22 +5,26 @@ import type {
5
5
ImageLoadEventData ,
6
6
ImageSourcePropType ,
7
7
ImageURISource ,
8
+ Image as RNImage ,
8
9
ImageProps as RNImageProps ,
9
10
} from 'react-native' ;
10
11
import { createLayoutEvent } from '../utils/createLayoutEvent' ;
11
12
import { createNativeSyntheticEvent } from '../utils/createNativeSyntheticEvent' ;
12
13
import type { ViewProps } from './View' ;
13
14
14
- export interface ImageProps extends RNImageProps , Omit < ViewProps , 'style' > {
15
- onImageLoaded ?: ( dimensions : { width : number ; height : number } ) => void ;
16
- }
15
+ export type ImageProps = RNImageProps &
16
+ Omit < ViewProps , 'style' > & {
17
+ onImageLoaded ?: ( dimensions : { width : number ; height : number } ) => void ;
18
+ } ;
17
19
18
20
function isImageURISource (
19
21
source : ImageSourcePropType ,
20
22
) : source is ImageURISource {
21
23
return ! Array . isArray ( source ) ;
22
24
}
23
25
26
+ export type Image = RNImage & LightningImageElement ;
27
+
24
28
export const Image = forwardRef < LightningImageElement , ImageProps > (
25
29
(
26
30
{
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import type {
5
5
Rect ,
6
6
} from '@plexinc/react-lightning' ;
7
7
import { forwardRef , useCallback , useMemo } from 'react' ;
8
- import type { TextProps as RNTextProps } from 'react-native' ;
8
+ import type { Text as RNText , TextProps as RNTextProps } from 'react-native' ;
9
9
import { createLayoutEvent } from '../utils/createLayoutEvent' ;
10
10
import type { ViewProps } from './View' ;
11
11
@@ -18,6 +18,8 @@ const defaultTextStyle: Partial<LightningTextElementStyle> = {
18
18
fontWeight : 'normal' ,
19
19
} ;
20
20
21
+ export type Text = RNText & LightningTextElement ;
22
+
21
23
export const Text = forwardRef < LightningTextElement , TextProps > (
22
24
(
23
25
{
Original file line number Diff line number Diff line change 1
1
import type {
2
2
FocusableProps ,
3
+ LightningElement ,
3
4
LightningViewElementProps ,
4
5
Rect ,
5
6
} from '@plexinc/react-lightning' ;
@@ -8,7 +9,7 @@ import type { LightningViewElement } from '@plexinc/react-lightning';
8
9
import type { AllStyleProps } from '@plexinc/react-lightning-plugin-css-transform' ;
9
10
import type { ForwardRefExoticComponent , RefAttributes } from 'react' ;
10
11
import { forwardRef , useCallback } from 'react' ;
11
- import type { ViewProps as RNViewProps } from 'react-native' ;
12
+ import type { View as RNView , ViewProps as RNViewProps } from 'react-native' ;
12
13
import { createLayoutEvent } from '../utils/createLayoutEvent' ;
13
14
14
15
type CombinedProps = RNViewProps &
@@ -32,6 +33,8 @@ export const defaultViewStyle = {
32
33
zIndex : 0 ,
33
34
} ;
34
35
36
+ export type View = RNView & LightningElement ;
37
+
35
38
export const View : ForwardRefExoticComponent < ViewProps > = forwardRef <
36
39
LightningViewElement ,
37
40
ViewProps
You can’t perform that action at this time.
0 commit comments