From dfa9bf2e690a698b5cadea5e658f72524ee07e11 Mon Sep 17 00:00:00 2001 From: dozoisch Date: Thu, 15 Oct 2015 17:24:29 -0400 Subject: [PATCH] [added] doc for react 0.14 + old 0.13 - also added the version for google ReCaptcha (v2) closes #4 --- README.md | 49 ++++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 3582626..767dae7 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![Dependencies][deps.img]][deps.url] [![Dev Dependencies][devdeps.img]][devdeps.url] -Component wrapper for [Google reCAPTCHA][reCAPTCHA] +Component wrapper for [Google reCAPTCHA v2][reCAPTCHA] ## Installation @@ -13,6 +13,12 @@ Component wrapper for [Google reCAPTCHA][reCAPTCHA] npm install --save react-google-recaptcha ``` +### React 0.13 +With 0.13, install version 0.4.0 +```shell +npm install --save react-google-recaptcha@0.4.0 +``` + ## Usage All 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 ```jsx var React = require("react"); +var render = require("react-dom").render var ReCAPTCHA = require("react-google-recaptcha"); function onChange(value) { console.log("Captcha value:", value); } -React.render( -, document.body); +render( + , + document.body +); ``` ### Rendering Props @@ -61,6 +70,7 @@ You can also use the barebone components doing the following. Using that compone ```jsx var React = require("react"); +var render = require("react-dom").render var ReCAPTCHA = require("react-google-recaptcha/lib/recaptcha"); var grecaptchaObject = grecaptcha // You must provide access to the google grecaptcha object. @@ -69,24 +79,17 @@ function onChange(value) { console.log("Captcha value:", value); } -React.render( -, document.body); +render( + , + document.body +); ``` - - -## To Come Soon -- tests -- examples -- code coverage - -*The build is highly inspired by [react-bootstrap][rb]* - [travis.img]: https://travis-ci.org/dozoisch/react-google-recaptcha.svg?branch=master [travis.url]: https://travis-ci.org/dozoisch/react-google-recaptcha [npm.img]: https://badge.fury.io/js/react-google-recaptcha.svg