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
+22-1
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,9 @@
2
2
3
3
This component is created in order to make the experience of integrating Google ReCaptcha into React apps easier and smoother.
4
4
5
-
P.S. It will open the ReCaptcha window only when there are some doubts by Google; otherwise, it will automatically generate the token.
5
+
Currently, we are using ReCaptcha V2 here. ReCaptcha V3 is still in beta version; so, we will update our component when they release the stable version.
6
+
7
+
P.S. It will open the ReCaptcha window only when there are some doubts by Google; otherwise, it will automatically generate the recaptcha token.
6
8
7
9
## Installation
8
10
@@ -28,6 +30,11 @@ componentDidMount() {
28
30
29
31
30
32
### 2. Use `ReCaptcha` to integrate ReCaptcha in a particular component
33
+
34
+
#### invisible Recaptcha
35
+
36
+
Create a new component with the following code and give it a try!
37
+
31
38
```
32
39
import React, { Component } from 'react';
33
40
import { ReCaptcha } from 'react-recaptcha-google'
@@ -83,3 +90,17 @@ class ExampleComponent extends Component {
83
90
export default ExampleComponent;
84
91
85
92
```
93
+
94
+
95
+
#### Visible / Normal Recaptcha
96
+
97
+
For having a visible ReCaptcha, you should make two minor changes on the above-mentioned code.
98
+
1. Replace the size prop value `invisible` (see the imported ReCaptcha component) with either `normal` or `compact`. Those will add a checkbox with 'I am not a robot' label.
99
+
2. Remove `this.[captchaRef].execute()` lines from your code.
100
+
101
+
102
+
103
+
##### Optional props
104
+
105
+
*`data-theme` - you can add `theme` prop with a value of either `"dark"` or `"light"`(default) to control the background theme of the visible ReCaptcha (when size is `normal` or `compact`)
106
+
*`data-badge` - you can send `badge` prop with one of the following values: bottomright (default), bottomleft, inline. This will allowyou to reposition the ReCaptcha badge.
0 commit comments