From 90a8d7568a63092d046e4909c53888e64a96e200 Mon Sep 17 00:00:00 2001 From: anday013 Date: Sat, 20 Apr 2024 00:24:32 +0200 Subject: [PATCH] docs: remove deprecated prop --- README.MD | 6 ++++-- src/OtpInput/OtpInput.types.ts | 3 +++ src/index.d.ts | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.MD b/README.MD index 5edfe69..9f76fa0 100644 --- a/README.MD +++ b/README.MD @@ -63,9 +63,11 @@ yarn add react-native-otp-entry focusStickBlinkingDuration={500} onTextChange={(text) => console.log(text)} onFilled={(text) => console.log(`OTP is ${text}`)} + textInputProps={{ + accessibilityLabel: "One-Time Password", + }} theme={{ containerStyle: styles.container, - inputsContainerStyle: styles.inputsContainer, pinCodeContainerStyle: styles.pinCodeContainer, pinCodeTextStyle: styles.pinCodeText, focusStickStyle: styles.focusStick, @@ -81,6 +83,7 @@ The `react-native-otp-entry` component accepts the following props: | Prop | Type | Description | | ---------------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------- | | `numberOfDigits` | number | The number of digits to be displayed in the OTP entry. | +| `textInputProps` | TextInputProps | Extra props passed to underlying hidden TextInput (see: https://reactnative.dev/docs/textinput) | | `autoFocus` | boolean | Default: true. Set autofocus. | | `focusColor` | ColorValue | The color of the input field border and stick when it is focused. | | `onTextChange` | (text: string) => void | A callback function is invoked when the OTP text changes. It receives the updated text as an argument. | @@ -89,7 +92,6 @@ The `react-native-otp-entry` component accepts the following props: | `theme` | Theme | Custom styles for each element. | | `focusStickBlinkingDuration` | number | The duration (in milliseconds) for the focus stick to blink. | | `disabled` | boolean | Default: false. Disable the input | -| `textInputProps` | TextInputProps | Extra props passed to underlying hidden TextInput (see: https://reactnative.dev/docs/textinput) | | Theme | Type | Description | | ------------------------------- | --------- | ---------------------------------------------------------------------------------- | diff --git a/src/OtpInput/OtpInput.types.ts b/src/OtpInput/OtpInput.types.ts index bcfda24..f1ecd96 100644 --- a/src/OtpInput/OtpInput.types.ts +++ b/src/OtpInput/OtpInput.types.ts @@ -22,6 +22,9 @@ export interface OtpInputRef { export interface Theme { containerStyle?: ViewStyle; + /** + * @deprecated Use `containerStyle` instead + */ inputsContainerStyle?: ViewStyle; pinCodeContainerStyle?: ViewStyle; filledPinCodeContainerStyle?: ViewStyle; diff --git a/src/index.d.ts b/src/index.d.ts index 31053b3..b732dfa 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -59,7 +59,7 @@ declare module "OTPInput" { containerStyle?: ViewStyle; /** - * Custom styles for the container that holds the input fields. + * @deprecated Use `containerStyle` instead */ inputsContainerStyle?: ViewStyle;