Skip to content

Commit 3ef5bc9

Browse files
authored
Merge pull request dozoisch#179 from codeth/isolated-recaptcha
Add `isolated` prop to component
2 parents 7676c9b + 5357d29 commit 3ef5bc9

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
@@ -44,6 +44,7 @@ Properties used to customise the rendering:
4444
| asyncScriptOnLoad | func | *optional* callback when the google recaptcha script has been loaded |
4545
| badge | enum | *optional* `bottomright`, `bottomleft` or `inline`. Positions reCAPTCHA badge. *Only for invisible reCAPTCHA* |
4646
| hl | string | *optional* set the hl parameter, which allows the captcha to be used from different languages, see [reCAPTCHA hl] |
47+
| 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`)*
4748
| onChange | func | The function to be called when the user successfully completes the captcha |
4849
| onErrored | func | *optional* callback when the challenge errored, most likely due to network issues. |
4950
| onExpired | func | *optional* callback when the challenge is expired and has to be redone by user. By default it will call the onChange with null to signify expired callback. |

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)