You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+47-8Lines changed: 47 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,13 +41,15 @@ Usually, your application only needs one provider. You should place it as high a
41
41
42
42
Same thing applied when you use this library with framework such as Next.js or React Router and only want to include the script on a single page. Try to make sure you only have one instance of the provider on a React tree and to place it as high (on the tree) as possible.
| reCaptchaKey | String || Yes | Your recaptcha key, get one from [here](https://www.google.com/recaptcha/intro/v3.html)|
47
-
| scriptProps | Object || No | You can customize the injected `script` tag with this prop. It allows you to add `async`, `defer`, `nonce` attributes to the script tag. You can also control whether the injected script will be added to the document body or head with `appendTo` attribute. |
48
-
| language | String || No | optional prop to support different languages that is supported by Google Recaptcha. https://developers.google.com/recaptcha/docs/language|
49
-
| useRecaptchaNet | Boolean | false | No | The provider also provide the prop `useRecaptchaNet` to load script from `recaptcha.net`: https://developers.google.com/recaptcha/docs/faq#can-i-use-recaptcha-globally|
50
-
| useEnterprise | Boolean | false | No |[Enterprise option](#enterprise)|
| reCaptchaKey | String || Yes | Your recaptcha key, get one from [here](https://www.google.com/recaptcha/intro/v3.html)|
47
+
| scriptProps | Object || No | You can customize the injected `script` tag with this prop. It allows you to add `async`, `defer`, `nonce` attributes to the script tag. You can also control whether the injected script will be added to the document body or head with `appendTo` attribute. |
48
+
| language | String || No | optional prop to support different languages that is supported by Google Recaptcha. https://developers.google.com/recaptcha/docs/language|
49
+
| useRecaptchaNet | Boolean | false | No | The provider also provide the prop `useRecaptchaNet` to load script from `recaptcha.net`: https://developers.google.com/recaptcha/docs/faq#can-i-use-recaptcha-globally|
50
+
| useEnterprise | Boolean | false | No |[Enterprise option](#enterprise)|
51
+
| container.element | String HTMLElement || No | Container ID where the recaptcha badge will be rendered |
52
+
| container.parameters | Object || No | Configuration for the inline badge (See google recaptcha docs) |
@@ -75,7 +84,7 @@ There are three ways to trigger the recaptcha validation: using the `GoogleReCap
75
84
76
85
#### GoogleReCaptcha
77
86
78
-
`GoogleRecaptcha` is a react component that can be used in your app to trigger the validation. It provides a prop `onVerify`, which will be called once the verify is done successfully.
87
+
`GoogleRecaptcha` is a react component that can be used in your app to trigger the validation. It provides a prop `onVerify`, which will be called once the verify is done successfully, also supports a prop `refreshReCaptcha` which supports any type of value and is used to force recaptcha to revalidate (you can use a timestamp updated after every submit), there is an example below.
If you prefer a React Hook approach over the old good Higher Order Component, you can choose to use the custom hook `useGoogleReCaptcha` over the HOC `withGoogleReCaptcha`.
0 commit comments