Skip to content

Commit afab920

Browse files
committed
Merge branch 'fix/platform-typing-3.4' of github.com:GeekyAnts/NativeBase into fix/ref-typing
2 parents c8d0660 + cec6f16 commit afab920

File tree

10 files changed

+26
-11
lines changed

10 files changed

+26
-11
lines changed

example/storybook/stories/components/composites/Alert/knobEnabled.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Alert, Box, CloseIcon, IconButton } from 'native-base';
2+
import { Alert, Box, CloseIcon, IconButton, Text } from 'native-base';
33
import { select } from '@storybook/addon-knobs';
44

55
export const Example = () => {
@@ -21,8 +21,8 @@ export const Example = () => {
2121
actionProps={{ alignSelf: 'center' }}
2222
>
2323
<Alert.Icon />
24-
<Alert.Title>Error Alert</Alert.Title>
25-
<Alert.Description>Description </Alert.Description>
24+
<Text>Error Alert</Text>
25+
<Text>Description </Text>
2626
</Alert>
2727
</Box>
2828
);

src/components/composites/AlertDialog/AlertDialog.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ const AlertDialog = (
7070
onRequestClose={handleClose}
7171
isKeyboardDismissable={isKeyboardDismissable}
7272
useRNModalOnAndroid
73+
unmountOnExit
7374
>
7475
<AlertDialogContext.Provider
7576
value={{

src/components/composites/AlertDialog/types.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { IBoxProps } from '../../primitives/Box';
1+
import type { IBoxProps, InterfaceBoxProps } from '../../primitives/Box';
22
import type { IIconButtonProps } from '../IconButton';
33
import type { MutableRefObject } from 'react';
44
import type { IFadeProps, ISlideProps } from '../Transitions';
@@ -7,7 +7,8 @@ import type {
77
ThemeComponentSizeType,
88
} from '../../../components/types/utils';
99

10-
export interface InterfaceAlertDialogProps extends IBoxProps {
10+
export interface InterfaceAlertDialogProps
11+
extends InterfaceBoxProps<IAlertDialogProps> {
1112
/**
1213
* If true, the AlertDialog will open. Useful for controllable state behaviour
1314
*/

src/components/composites/IconButton/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ const IconButton = (
5151
if (icon) {
5252
clonedIcon = React.cloneElement(icon, {
5353
..._icon,
54+
...icon?.props,
5455
});
5556
}
5657

src/components/composites/IconButton/types.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import type { InterfacePressableProps } from '../../primitives/Pressable/types';
22
import type { IIconProps } from '../../primitives/Icon';
3-
import type { ColorSchemeType } from '../../../components/types';
3+
import type { ColorSchemeType, PlatformProps } from '../../../components/types';
44

55
import type { CustomProps, VariantType } from '../../types';
66
import type { ThemeComponentSizeType } from '../../../components/types/utils';
77
export interface InterfaceIconButtonProps
8-
extends Omit<InterfacePressableProps, 'children' | 'color'>,
8+
extends Omit<
9+
InterfacePressableProps,
10+
'children' | 'color' | '_light' | '_dark' | '_web' | '_android' | '_ios'
11+
>,
912
Omit<
1013
IIconProps,
1114
| 'delayLongPress'
@@ -22,7 +25,8 @@ export interface InterfaceIconButtonProps
2225
| '_web'
2326
| '_android'
2427
| '_ios'
25-
> {
28+
>,
29+
PlatformProps<IIconButtonProps> {
2630
/**
2731
* The color of the radio when it's checked. This should be one of the color keys in the theme (e.g."green", "red").
2832
* @default 'primary'

src/components/primitives/Checkbox/Checkbox.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ const Checkbox = (
7272
const inputProps = React.useMemo(() => groupItemInputProps, [
7373
groupItemInputProps.checked,
7474
groupItemInputProps.disabled,
75+
groupItemInputProps,
7576
]);
7677

7778
const [contextCombinedProps] = React.useState({

src/components/primitives/Checkbox/Checkbox.web.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ const Checkbox = (
7676
const inputProps = React.useMemo(() => groupItemInputProps, [
7777
groupItemInputProps.checked,
7878
groupItemInputProps.disabled,
79+
groupItemInputProps,
7980
]);
8081

8182
const [contextCombinedProps] = React.useState({

src/components/primitives/Icon/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import type { CustomProps, ThemeComponentSizeType } from '../../types/utils';
99
export interface InterfaceIconProps
1010
extends Omit<
1111
SvgProps,
12-
'opacity' | 'fill' | 'stroke' | 'height' | 'width' | 'transform' | 'color'
12+
'opacity' | 'stroke' | 'height' | 'width' | 'transform' | 'color'
1313
>,
1414
StyledProps,
1515
PlatformProps<IIconProps> {

src/components/primitives/Input/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import type { IStackProps } from '../Stack/Stack';
1313
import type { MutableRefObject } from 'react';
1414

1515
export interface InterfaceInputProps
16-
extends PlatformProps<any>,
16+
extends PlatformProps<IInputProps>,
1717
Omit<TextInputProps, 'textAlign'>,
1818
StyledProps {
1919
/**

src/components/primitives/TextArea/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ import { usePropsResolution } from '../../../hooks/useThemeProps';
55
import { useHasResponsiveProps } from '../../../hooks/useHasResponsiveProps';
66
import { useHover } from '@react-native-aria/interactions';
77
import { mergeRefs } from '../../../utils';
8-
export interface ITextAreaProps extends InterfaceInputProps {
8+
import type { PlatformProps } from '../../../components/types';
9+
export interface ITextAreaProps
10+
extends Omit<
11+
InterfaceInputProps,
12+
'_web' | '_android' | '_ios' | '_light' | '_dark'
13+
>,
14+
PlatformProps<ITextAreaProps> {
915
/**
1016
* Maps to react-native TextInput's numberOfLines.
1117
*/

0 commit comments

Comments
 (0)