@hirbod/react-native-otp-input
Version:
is a tiny JS library for one time passcode (OTP). Supports smart input suggestion on iOS and code autofill on Android (it will be filled when you press the copy button on the SMS notification bar)
31 lines (30 loc) • 1.17 kB
TypeScript
/// <reference path="../index.d.ts" />
import { InputProps, OTPInputViewState } from "@hirbod/react-native-otp-input";
import { Component } from "react";
import { TextInput } from "react-native";
export default class OTPInputView extends Component<InputProps, OTPInputViewState> {
static defaultProps: InputProps;
private fields;
private keyboardDidHideListener?;
private timer?;
private hasCheckedClipBoard?;
private clipBoardCode?;
constructor(props: InputProps);
UNSAFE_componentWillReceiveProps(nextProps: InputProps): void;
componentDidMount(): void;
componentWillUnmount(): void;
private copyCodeFromClipBoardOnAndroid;
bringUpKeyBoardIfNeeded: () => void;
getDigits: () => string[];
private handleKeyboardDidHide;
private notifyCodeChanged;
checkPinCodeFromClipBoard: () => void;
private handleChangeText;
private handleKeyPressTextInput;
focusField: (index: number) => void;
blurAllFields: () => void;
clearAllFields: () => void;
renderOneInputField: (_: TextInput, index: number) => JSX.Element;
renderTextFields: () => JSX.Element[];
render(): JSX.Element;
}