Skip to content

Commit

Permalink
feat(demo): Execute async hCaptcha on component mount (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
zoryana94 authored Aug 14, 2024
1 parent 557b338 commit 96924fa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion demo/app/examples/AsyncExample.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useRef } from 'react';
import React, { useRef, useEffect } from 'react';

import HCaptcha from '../../../src/index.js';

Expand All @@ -17,6 +17,10 @@ export function AsyncExample() {
}
};

useEffect(() => {
executeCaptcha();
}, []);

const getResponse = () => {
try {
const res = captchaRef.current.getResponse();
Expand Down

0 comments on commit 96924fa

Please sign in to comment.