55[ ![ Dependencies] [ deps.img ]] [ deps.url ]
66[ ![ Dev Dependencies] [ devdeps.img ]] [ devdeps.url ]
77
8- Component wrapper for [ Google reCAPTCHA] [ reCAPTCHA ]
8+ Component wrapper for [ Google reCAPTCHA v2 ] [ reCAPTCHA ]
99
1010## Installation
1111
1212``` shell
1313npm install --save react-google-recaptcha
1414```
1515
16+ ### React 0.13
17+ With 0.13, install version 0.4.0
18+ ``` shell
19+ npm install --save
[email protected] 20+ ```
21+
1622## Usage
1723
1824All you need to do is [ sign up for an API key pair] [ signup ] . You will need the client key.
@@ -21,18 +27,21 @@ You can then use the reCAPTCHA. The default require, imports a wrapped component
2127
2228``` jsx
2329var React = require (" react" );
30+ var render = require (" react-dom" ).render
2431var ReCAPTCHA = require (" react-google-recaptcha" );
2532
2633function onChange (value ) {
2734 console .log (" Captcha value:" , value);
2835}
2936
30- React .render (
31- < ReCAPTCHA
32- ref= " recaptcha"
33- sitekey= " Your client site key"
34- onChange= {onChange}
35- / > , document .body );
37+ render (
38+ < ReCAPTCHA
39+ ref= " recaptcha"
40+ sitekey= " Your client site key"
41+ onChange= {onChange}
42+ / > ,
43+ document .body
44+ );
3645```
3746
3847### Rendering Props
@@ -61,6 +70,7 @@ You can also use the barebone components doing the following. Using that compone
6170
6271``` jsx
6372var React = require (" react" );
73+ var render = require (" react-dom" ).render
6474var ReCAPTCHA = require (" react-google-recaptcha/lib/recaptcha" );
6575
6676var grecaptchaObject = grecaptcha // You must provide access to the google grecaptcha object.
@@ -69,24 +79,17 @@ function onChange(value) {
6979 console .log (" Captcha value:" , value);
7080}
7181
72- React .render (
73- < ReCAPTCHA
74- ref= " recaptcha"
75- sitekey= " Your client site key"
76- onChange= {onChange}
77- grecaptcha= {grecaptchaObject}
78- / > , document .body );
82+ render (
83+ < ReCAPTCHA
84+ ref= " recaptcha"
85+ sitekey= " Your client site key"
86+ onChange= {onChange}
87+ grecaptcha= {grecaptchaObject}
88+ / > ,
89+ document .body
90+ );
7991```
8092
81-
82-
83- ## To Come Soon
84- - tests
85- - examples
86- - code coverage
87-
88- * The build is highly inspired by [ react-bootstrap] [ rb ] *
89-
9093[ travis.img ] : https://travis-ci.org/dozoisch/react-google-recaptcha.svg?branch=master
9194[ travis.url ] : https://travis-ci.org/dozoisch/react-google-recaptcha
9295[ npm.img ] : https://badge.fury.io/js/react-google-recaptcha.svg
0 commit comments