Skip to content

Commit 0ded830

Browse files
committed
Added the isolated prop to allow the option to be set on the recaptcha, as per google documentation
1 parent 7676c9b commit 0ded830

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Properties used to customise the rendering:
5353
| tabindex | number | *optional* The tabindex on the element *(__default:__ `0`)*
5454
| type | enum | *optional* `image` or `audio` The type of initial captcha *(__defaults:__ `image`)*
5555
| theme | enum | *optional* `light` or `dark` The theme of the widget *(__defaults:__ `light`)*. See [example][docs_theme]
56+
| isolated | bool | *optional* For plugin owners to not interfere with existing reCAPTCHA installations on a page. If true, this reCAPTCHA instance will be part of a separate ID space. *(__default:__ `false`)*
5657

5758
### Component Instance API
5859

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/recaptcha.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export default class ReCAPTCHA extends React.Component {
9393
stoken: this.props.stoken,
9494
hl: this.props.hl,
9595
badge: this.props.badge,
96+
isolated: this.props.isolated,
9697
});
9798
this.captcha.appendChild(wrapper);
9899
}
@@ -153,6 +154,7 @@ export default class ReCAPTCHA extends React.Component {
153154
grecaptcha,
154155
badge,
155156
hl,
157+
isolated,
156158
...childProps
157159
} = this.props;
158160
/* eslint-enable no-unused-vars */
@@ -174,6 +176,7 @@ ReCAPTCHA.propTypes = {
174176
stoken: PropTypes.string,
175177
hl: PropTypes.string,
176178
badge: PropTypes.oneOf(["bottomright", "bottomleft", "inline"]),
179+
isolated: PropTypes.bool,
177180
};
178181
ReCAPTCHA.defaultProps = {
179182
onChange: () => {},

0 commit comments

Comments
 (0)