Skip to content

Commit 6d9e3d5

Browse files
#192 - Add custom input comp props (#193)
Co-authored-by: Müslüm Sezgin <[email protected]>
1 parent 0b3fa93 commit 6d9e3d5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/CodeField.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export interface Props extends TextInputPropsWithoutStyle {
2424
renderCell: (options: RenderCellOptions) => ReactNode;
2525
RootProps?: ViewProps;
2626
RootComponent?: ComponentType<ViewProps>;
27+
InputComponent?: ComponentType<TextInputProps>;
2728
rootStyle?: ViewProps['style'];
2829
textInputStyle?: StyleProp<TextStyle>;
2930
cellCount?: number;
@@ -42,6 +43,7 @@ function CodeFieldComponent(
4243
cellCount = DEFAULT_CELL_COUNT,
4344
RootProps = {},
4445
RootComponent = View,
46+
InputComponent = TextInput,
4547
...rest
4648
}: Props,
4749
ref: Ref<TextInput>,
@@ -62,7 +64,7 @@ function CodeFieldComponent(
6264
return (
6365
<RootComponent {...RootProps} style={getStyle(styles.root, rootStyle)}>
6466
{cells}
65-
<TextInput
67+
<InputComponent
6668
disableFullscreenUI
6769
// Use `caretHidden={false}` when `value={''}` and user can't paste\copy text because menu doesn't appear
6870
// See more: https://github.com/retyui/react-native-confirmation-code-field/issues/140

0 commit comments

Comments
 (0)