dozoisch / dozoisch/react-google-recaptcha

Possible to make execute function Promise-based?

Open
#72 2 comments 12 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.1k
Forks
148
PR merge metrics
No merged PRs in 30d

Description

I have a parent component to the component that actually uses the invisible recaptcha facility. In my case (below) the `onSubmit` and `onChange` functions are passed down from this parent component, so how do I get the value returned by `captcha.execute()` into the `onSubmit` function so that I can include it in the request payload sent to my server:

```
// Child component.
var React = require("react").default;
var render = require("react-dom").render
var ReCAPTCHA = require("react-google-recaptcha");

class Child extends React.Component {
...
render(
return (

{ this.captcha = el; }}
size="invisible"
sitekey="Your client site key"
onChange={this.props.onChange}
/>

)
);
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.