Skip to content

Commit 5841582

Browse files
author
Michael Trotter
committed
1 parent cf7078b commit 5841582

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
"homepage": "https://github.com/dozoisch/react-google-recaptcha",
3232
"peerDependencies": {
33-
"react": ">=0.13"
33+
"react": ">=0.14"
3434
},
3535
"devDependencies": {
3636
"babel": "~5.8.21",
@@ -56,10 +56,11 @@
5656
"karma-webpack": "~1.7.0",
5757
"lodash": "~3.10.1",
5858
"mocha": "~2.2.5",
59-
"react": "~0.13.3",
59+
"phantomjs": "^1.9.18",
60+
"react": "~0.14.0",
61+
"react-dom": "~0.14.0",
6062
"webpack": "~1.11.0",
6163
"yargs": "~3.19.0"
62-
6364
},
6465
"dependencies": {
6566
"babel-runtime": "^5.8.0",

src/recaptcha.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ const ReCAPTCHA = React.createClass({
4949

5050
explicitRender(cb) {
5151
if (this.props.grecaptcha && !this.state.widgetId) {
52-
this.captcha.getDOMNode();
53-
let id = this.props.grecaptcha.render(this.captcha.getDOMNode(), {
52+
this.refs.captcha;
53+
let id = this.props.grecaptcha.render(this.refs.captcha, {
5454
sitekey: this.props.sitekey,
5555
callback: this.props.onChange,
5656
theme: this.props.theme,
@@ -79,7 +79,7 @@ const ReCAPTCHA = React.createClass({
7979
let { sitekey, onChange, theme, type, tabindex, onExpired, size, ...childProps } = this.props;
8080
/* eslint-enable no-unused-vars */
8181
return (
82-
<div {...childProps} ref={(component) => { this.captcha = component; }} />
82+
<div {...childProps} ref="captcha" />
8383
);
8484
},
8585
});

test/recaptcha-spec.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from "react";
2+
import ReactDOM from "react-dom";
23
import ReactTestUtils from "react/lib/ReactTestUtils";
34
import ReCAPTCHA from "../src/recaptcha";
45

@@ -7,7 +8,7 @@ describe("ReCAPTCHA", () => {
78
let instance = ReactTestUtils.renderIntoDocument(
89
<ReCAPTCHA sitekey="xxx" />
910
);
10-
assert.equal(instance.getDOMNode().nodeName, "DIV");
11+
assert.equal(ReactDOM.findDOMNode(instance).nodeName, "DIV");
1112
});
1213
it("Rendered Component should contained passed props", () => {
1314
let props = {
@@ -17,8 +18,8 @@ describe("ReCAPTCHA", () => {
1718
let instance = ReactTestUtils.renderIntoDocument(
1819
<ReCAPTCHA sitekey="xxx" {...props} />
1920
);
20-
assert.equal(instance.getDOMNode().id, props.id);
21-
assert.match(instance.getDOMNode().className, new RegExp(props.className));
21+
assert.equal(ReactDOM.findDOMNode(instance).id, props.id);
22+
assert.match(ReactDOM.findDOMNode(instance).className, new RegExp(props.className));
2223
});
2324

2425
it("should call grecaptcha.render, when it is already loaded", (done) => {

0 commit comments

Comments
 (0)