{"action":"opened","issue":{"url":"https://api.github.com/repos/appleboy/react-recaptcha/issues/231","repository_url":"https://api.github.com/repos/appleboy/react-recaptcha","labels_url":"https://api.github.com/repos/appleboy/react-recaptcha/issues/231/labels{/name}","comments_url":"https://api.github.com/repos/appleboy/react-recaptcha/issues/231/comments","events_url":"https://api.github.com/repos/appleboy/react-recaptcha/issues/231/events","html_url":"https://github.com/appleboy/react-recaptcha/issues/231","id":314387992,"number":231,"title":".verifyCallback() does not work with es6 classes","user":{"login":"reZach","id":4740370,"avatar_url":"https://avatars1.githubusercontent.com/u/4740370?v=4","gravatar_id":"","url":"https://api.github.com/users/reZach","html_url":"https://github.com/reZach","followers_url":"https://api.github.com/users/reZach/followers","following_url":"https://api.github.com/users/reZach/following{/other_user}","gists_url":"https://api.github.com/users/reZach/gists{/gist_id}","starred_url":"https://api.github.com/users/reZach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reZach/subscriptions","organizations_url":"https://api.github.com/users/reZach/orgs","repos_url":"https://api.github.com/users/reZach/repos","events_url":"https://api.github.com/users/reZach/events{/privacy}","received_events_url":"https://api.github.com/users/reZach/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-15T05:47:40Z","updated_at":"2018-04-15T05:47:40Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nWhen calling the `.execute()` method on the recaptcha instance, the `verifyCallback` function is not called if within an es6 class. The `verifyCallback` is only called when outside the class. This is not ideal as it doesn't allow you to submit a form.\r\n\r\n**Doesn't work**\r\n\r\n    import * as React from 'react';\r\n    import { RouteComponentProps } from 'react-router';\r\n    var Recaptcha = require('react-recaptcha');\r\n\r\n    export class Submit extends React.Component<RouteComponentProps<{}>, {}>{\r\n        recaptchaInstance: any;\r\n        constructor() {\r\n            super();\r\n\r\n            this.executeCaptcha = this.executeCaptcha.bind(this);\r\n            this.verifyCallback = this.verifyCallback.bind(this);\r\n        }\r\n\r\n        executeCaptcha() {\r\n            this.recaptchaInstance.execute();\r\n        }\r\n\r\n        verifyCallback(response){\r\n            console.log(response); // never is called\r\n            // submit form\r\n        }\r\n\r\n        render() {\r\n            return <div>\r\n                <form onSubmit={this.executeCaptcha}>\r\n                    <button>Send</button>\r\n                </form>\r\n                <Recaptcha\r\n                     ref={e => this.recaptchaInstance = e}\r\n                     sitekey=\"xxxxxxxxxxxxxxxxxxxx\"\r\n                     size=\"invisible\"\r\n                     verifyCallback={this.verifyCallback}\r\n                />\r\n            </div>;\r\n        }\r\n    }\r\n\r\n\r\nIt _does_ work this way\r\n\r\n    import * as React from 'react';\r\n    import { RouteComponentProps } from 'react-router';\r\n    var Recaptcha = require('react-recaptcha');\r\n\r\n    const verifyCallback = function(response){\r\n        console.log(response);\r\n        // can't submit form now!? (or is there a way)\r\n    }\r\n\r\n    export class Submit extends React.Component<RouteComponentProps<{}>, {}>{\r\n        recaptchaInstance: any;\r\n        constructor() {\r\n            super();\r\n\r\n            this.executeCaptcha = this.executeCaptcha.bind(this);\r\n            this.verifyCallback = this.verifyCallback.bind(this);\r\n        }\r\n\r\n        executeCaptcha() {\r\n            this.recaptchaInstance.execute();\r\n        }\r\n\r\n        verifyCallback(response){\r\n            console.log(response); // never is called\r\n        }\r\n\r\n        render() {\r\n            return <div>\r\n                <form onSubmit={this.executeCaptcha}>\r\n                    <button>Send</button>\r\n                </form>\r\n                <Recaptcha\r\n                     ref={e => this.recaptchaInstance = e}\r\n                     sitekey=\"xxxxxxxxxxxxxxxxxxxx\"\r\n                     size=\"invisible\"\r\n                     verifyCallback={this.verifyCallback}\r\n                />\r\n            </div>;\r\n        }\r\n    }\r\n\r\n\r\nIs there a way we can stick the `verifyCallback` in the class?"}}
{"actor":{"display_login":"reZach"}}