forked from jarden-digital/react-native-recaptchav3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.tsx
36 lines (28 loc) · 775 Bytes
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import * as React from 'react'
import ReCaptchaComponent from "./src/ReCaptchaComponent";
export type IProps = {
captchaDomain: string
onReceiveToken: (captchaToken: string) => void
siteKey: string
action: string
}
export type IState = {}
class ReCaptchaV3 extends React.PureComponent<IProps, IState> {
private _captchaRef: any
public refreshToken = () => {
this._captchaRef.refreshToken()
}
render() {
return (
<ReCaptchaComponent
ref={ref => this._captchaRef = ref}
action={this.props.action}
captchaDomain={this.props.captchaDomain}
siteKey={this.props.siteKey}
onReceiveToken={(token: string) => {
this.props.onReceiveToken(token)
}}/>
)
}
}
export default ReCaptchaV3