Skip to content

Commit

Permalink
feat: added getResponse example
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyOGo authored and jsardev committed Dec 28, 2019
1 parent d04dbfe commit 274e4cf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions example/src/modules/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ export default class Example extends Component<Props, State> {
}
};

getResponseRecaptcha = () => {
if (this.captcha) {
this.captcha.getResponse().then(response => {
alert(response);
});
}
};

submitForm = (invisible: boolean) => (e: SyntheticEvent<HTMLFormElement>) => {
e.preventDefault();
if (invisible) {
Expand Down Expand Up @@ -143,6 +151,9 @@ export default class Example extends Component<Props, State> {
<Button onClick={this.resetRecaptcha} disabled={!verified} ml>
Reset
</Button>
<Button onClick={this.getResponseRecaptcha} ml>
Get Response
</Button>
</Container>
</form>
</Fragment>
Expand Down

0 comments on commit 274e4cf

Please sign in to comment.