1.0.5 • Published 2 years ago
react-otp-resender v1.0.5
React Otp Resender
to install run:
yarn add react-otp-resender
Usage
Just import the component and pass the second and styles in otp component.
import React from 'react'
import ReactOtpResender from 'react-otp-resender';
class App extends React.Component {
//callback of resend button
resendEvent() {
// You can do what ever you want & reset timer too.
}
render() {
return (
<div>
<h1>Otp Timer counter</h1>
<ReactOtpResender
seconds={120}
textStyle={{
color: 'white'
}}
resendBtnText={'Send OTP again'}
resendBtnStyle={{
color: 'white',
backgroundColor: 'transparent',
outline: 'none',
border: 0,
cursor: 'pointer'
}}
resendFunc={ _ => this.resendEvent()}
/>
</div>
</div>
)
}
}
export default App
#API