UNPKG
recaptcha-v3-react-function-async
Version:
latest (0.0.5)
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
0.0.0
This library helps to integrate google recaptcha into your react project easily.
recaptcha-v3-react-function-async
/
src
/
loadReCaptcha.js
16 lines
(12 loc)
•
344 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
'use client'
export
default
async
(key) => {
try
{
let
script =
document
.
createElement
(
'script'
) script.
src
=
`https://www.google.com/recaptcha/api.js?render=
${key}
`
script.
async
=
true
document
.
body
.
appendChild
(script)
return
true
}
catch
(e) {
return
{
err
: e} } }