Skip to content

Commit

Permalink
docs: remove deprecated prop
Browse files Browse the repository at this point in the history
  • Loading branch information
anday013 committed Apr 19, 2024
1 parent f496714 commit 90a8d75
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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. |
Expand All @@ -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 |
| ------------------------------- | --------- | ---------------------------------------------------------------------------------- |
Expand Down
3 changes: 3 additions & 0 deletions src/OtpInput/OtpInput.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export interface OtpInputRef {

export interface Theme {
containerStyle?: ViewStyle;
/**
* @deprecated Use `containerStyle` instead
*/
inputsContainerStyle?: ViewStyle;
pinCodeContainerStyle?: ViewStyle;
filledPinCodeContainerStyle?: ViewStyle;
Expand Down
2 changes: 1 addition & 1 deletion src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 90a8d75

Please sign in to comment.