A simple, lightweight, customizable PIN code input component for React Native.
npm install rn-pin-entryA simple, lightweight, customizable PIN code input component for React Native.
``sh`
npm install rn-pin-entry
`jsx
import RNPinEntry from 'rn-pin-entry';
export default function App() {
const ref = React.useRef();
const [code, setCode] = React.useState('');
const checkCode = (c) => {
if (c !== '1234') {
ref.current?.shake().then(() => setCode(''));
}
}
return (
value={code}
onTextChange={c => setCode(c)}
onFulfill={this._checkCode}
/>
)
}
``
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
---
Made with create-react-native-library