react-google-recaptcha-hooks
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

react-google-recaptcha-hooks

Made with create-react-library

NPM JavaScript Style Guide

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

Readme

Keywords

none

Package Sidebar

Install

npm i react-google-recaptcha-hooks

Weekly Downloads

46

Version

1.0.2

License

MIT

Unpacked Size

34 kB

Total Files

12

Last publish

Collaborators

  • rainstormza