- Install package -
npm i react-google-recaptcha
- Get the test site key from google documentation
- Check the implementation in App.js
- Captcha includes the following two listeners among others -
onChange
andonExpired
. - When user clicks on a captcha, onChange gets fired and a token is passed to the onChange function in place of the event object.
- After about 90s the same token gets expired. The checkbox gets unchecked and event object returns undefined.