@hcaptcha/react-hcaptcha
Advanced tools
Comparing version 0.1.8 to 0.1.9
@@ -54,5 +54,9 @@ 'use strict'; | ||
// API Methods | ||
var _this = _possibleConstructorReturn(this, (HCaptcha.__proto__ || Object.getPrototypeOf(HCaptcha)).call(this, props)); | ||
var _props$id = props.id, | ||
id = _props$id === undefined ? null : _props$id; | ||
// API Methods | ||
_this.renderCaptcha = _this.renderCaptcha.bind(_this); | ||
@@ -71,3 +75,3 @@ _this.resetCaptcha = _this.resetCaptcha.bind(_this); | ||
isRemoved: false, | ||
elementId: 'hcaptcha-' + nanoid(), | ||
elementId: id || 'hcaptcha-' + nanoid(), | ||
captchaId: '' | ||
@@ -74,0 +78,0 @@ }; |
{ | ||
"name": "@hcaptcha/react-hcaptcha", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "A React library for hCaptcha", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -29,4 +29,4 @@ # React hCaptcha Component Library | ||
<FormComponent> | ||
<HCaptcha | ||
sitekey="your-sitekey" | ||
<HCaptcha | ||
sitekey="your-sitekey" | ||
onVerify={token => handleVerificationSuccess(token)} | ||
@@ -75,2 +75,4 @@ /> | ||
- Manually set the language used to render text in the hCaptcha API. See [language codes](https://hcaptcha.com/docs/languages). | ||
- id: String | ||
- Manually set the ID of the hCaptcha component. Make sure each hCaptcha component generated on a single page has its own unique ID when using this prop. | ||
@@ -77,0 +79,0 @@ The component emits events related to verification and expiration. Simply catch these events in the parent component: `onVerify`, `onExpire`, `onError` and handle the events as you choose. The captcha will automatically reset on error, but still emits an error. |
@@ -39,2 +39,3 @@ const React = require('react'); | ||
super(props); | ||
const { id=null } = props; | ||
@@ -55,3 +56,3 @@ // API Methods | ||
isRemoved: false, | ||
elementId: `hcaptcha-${nanoid()}`, | ||
elementId: id || `hcaptcha-${nanoid()}`, | ||
captchaId: '' | ||
@@ -58,0 +59,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31210
588
96