diff --git a/package.json b/package.json index eff66d1..5dde800 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ }, "homepage": "https://github.com/dozoisch/react-google-recaptcha", "peerDependencies": { - "react": ">=0.13" + "react": ">=0.14" }, "devDependencies": { "babel": "~5.8.21", @@ -56,10 +56,11 @@ "karma-webpack": "~1.7.0", "lodash": "~3.10.1", "mocha": "~2.2.5", - "react": "~0.13.3", + "phantomjs": "^1.9.18", + "react": "~0.14.0", + "react-dom": "~0.14.0", "webpack": "~1.11.0", "yargs": "~3.19.0" - }, "dependencies": { "babel-runtime": "^5.8.0", diff --git a/src/recaptcha.js b/src/recaptcha.js index 888e4ee..9bfaabc 100644 --- a/src/recaptcha.js +++ b/src/recaptcha.js @@ -49,8 +49,8 @@ const ReCAPTCHA = React.createClass({ explicitRender(cb) { if (this.props.grecaptcha && !this.state.widgetId) { - this.captcha.getDOMNode(); - let id = this.props.grecaptcha.render(this.captcha.getDOMNode(), { + this.refs.captcha; + let id = this.props.grecaptcha.render(this.refs.captcha, { sitekey: this.props.sitekey, callback: this.props.onChange, theme: this.props.theme, @@ -79,7 +79,7 @@ const ReCAPTCHA = React.createClass({ let { sitekey, onChange, theme, type, tabindex, onExpired, size, ...childProps } = this.props; /* eslint-enable no-unused-vars */ return ( -
{ this.captcha = component; }} /> +
); }, }); diff --git a/test/recaptcha-spec.js b/test/recaptcha-spec.js index c8f7fe8..a6d2a7a 100644 --- a/test/recaptcha-spec.js +++ b/test/recaptcha-spec.js @@ -1,4 +1,5 @@ import React from "react"; +import ReactDOM from "react-dom"; import ReactTestUtils from "react/lib/ReactTestUtils"; import ReCAPTCHA from "../src/recaptcha"; @@ -7,7 +8,7 @@ describe("ReCAPTCHA", () => { let instance = ReactTestUtils.renderIntoDocument( ); - assert.equal(instance.getDOMNode().nodeName, "DIV"); + assert.equal(ReactDOM.findDOMNode(instance).nodeName, "DIV"); }); it("Rendered Component should contained passed props", () => { let props = { @@ -17,8 +18,8 @@ describe("ReCAPTCHA", () => { let instance = ReactTestUtils.renderIntoDocument( ); - assert.equal(instance.getDOMNode().id, props.id); - assert.match(instance.getDOMNode().className, new RegExp(props.className)); + assert.equal(ReactDOM.findDOMNode(instance).id, props.id); + assert.match(ReactDOM.findDOMNode(instance).className, new RegExp(props.className)); }); it("should call grecaptcha.render, when it is already loaded", (done) => {