react-grecaptcha-v3
Version:
Google Recaptcha V3 for React.js based application. Keep website performance high while prioritizing security.
11 lines (10 loc) • 369 B
JavaScript
import { useContext } from 'react';
import makeContextError from './makeContextError';
import { Context } from './ReCaptchaProvider';
const useExecuteReCaptcha = () => {
return (useContext(Context)?.executeRecaptcha ??
(action => {
return Promise.reject(makeContextError(`${action} missed`));
}));
};
export default useExecuteReCaptcha;