Socket
Socket
Sign inDemoInstall

react-hook-recaptcha

Package Overview
Dependencies
6
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.2 to 1.0.3

2

package.json
{
"name": "react-hook-recaptcha",
"version": "1.0.2",
"version": "1.0.3",
"description": "React hook for google-recaptcha v2",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -34,2 +34,5 @@ # react-hook-recaptcha

![checkbox recaptcha demo](https://github.com/tomliangg/react-hook-recaptcha/blob/main/demo/checkbox_recaptcha.gif)
Codesandbox demo: https://codesandbox.io/s/userecaptcha-example-checkbox-ogppw?file=/src/App.js
```jsx

@@ -85,3 +88,2 @@ import React, { useState } from "react";

Codesandbox demo: https://codesandbox.io/s/userecaptcha-example-checkbox-ogppw?file=/src/App.js

@@ -91,3 +93,5 @@ ### Example 2 - Invisible reCAPTCHA - Programmatically invoke the challenge

It's more versatile to programmatically invoke the challenge. This way, you can control the flow of resetting and excuting recaptcha. This example works well with form that requires validation. Whenever a form fails the validation, you can reset the recaptcha and get a new response in the new submit.
Codesandbox demo: https://codesandbox.io/s/userecaptcha-example-invisible-tr32u?file=/src/App.js
It's more versatile to programmatically invoke the challenge. This way, you can control the flow of resetting and executing recaptcha. This example works well with form that requires validation. Whenever a form fails the validation, you can reset the recaptcha and get a new response in the new submit.
```jsx

@@ -140,3 +144,2 @@ import React from "react";

```
Codesandbox demo: https://codesandbox.io/s/userecaptcha-example-invisible-tr32u?file=/src/App.js

@@ -146,2 +149,4 @@

Codesandbox demo: https://codesandbox.io/s/userecaptcha-example-bind-challenge-to-a-button-jxyjf?file=/src/App.js
It's very much like Example 2 but a bit simpler. The downside of automatically binding the challenge is that it doesn't work well if the form requires validation because this approach will have a problem resubmitting.

@@ -186,3 +191,2 @@ ```jsx

```
Codesandbox demo: https://codesandbox.io/s/userecaptcha-example-bind-challenge-to-a-button-jxyjf?file=/src/App.js

@@ -193,2 +197,4 @@

Codesandbox demo: https://codesandbox.io/s/userecaptcha-example-using-with-react-hook-form-wyk4g?file=/src/App.js
useRecaptcha hook can work with any form libraries. Using react-hook-form for an example:

@@ -263,2 +269,1 @@ ```jsx

```
Codesandbox demo: https://codesandbox.io/s/userecaptcha-example-using-with-react-hook-form-wyk4g?file=/src/App.js
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc