react-google-recaptcha-hooks
v1.0.2
Published
Made with create-react-library
Downloads
1,072
Readme
react-google-recaptcha-hooks
Made with create-react-library
Install
npm install --save react-google-recaptcha-hooks
Usage
import React from 'react'
import { useGoogleReCaptchaV2 } from 'react-google-recaptcha-hooks'
const App = () => {
const {
ReCaptchaBadge,
executeReCaptcha,
resetReCaptcha
} = useGoogleReCaptchaV2({
siteKey: '',
language: 'en'
})
const handleClick = async () => {
const token = await executeReCaptcha()
setTimeout(() => {
resetReCaptcha()
}, 3000)
}
return (
<div>
{ReCaptchaBadge}
<button onClick={handleClick}>Click</button>
</div>
)
}
export default App
License
MIT © armspkt