Skip to content

Commit

Permalink
chore: add cleanup prop
Browse files Browse the repository at this point in the history
  • Loading branch information
faris-imi committed Nov 8, 2023
1 parent c653156 commit 80ad74d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ return <HCaptcha ref={captchaRef} onLoad={onLoad} sitekey={sitekey} {...props} /
|`imghost`|String|No|`-`|See enterprise docs.|
|`reportapi`|String|No|`-`|See enterprise docs.|
|`sentry`|String|No|`-`|See enterprise docs.|
| `cleanup` | Boolean | No | `true` | Remove script tag after setup.|
|`custom`|Boolean|No|`-`|See enterprise docs.|
|`loadAsync`|Boolean|No|`true`|Set if the script should be loaded asynchronously.|
|`scriptLocation`|Element|No|`document.head`| Location of where to append the script tag. Make sure to add it to an area that will persist to prevent loading multiple times in the same document view. Note: If `null` is provided, the `document.head` will be used.|
Expand Down
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ class HCaptcha extends React.Component {
sentry,
custom,
loadAsync,
scriptLocation
scriptLocation,
cleanup = true,
} = this.props;
const mountParams = {
render: 'explicit',
Expand All @@ -154,6 +155,7 @@ class HCaptcha extends React.Component {
custom,
loadAsync,
scriptLocation,
cleanup
};

hCaptchaLoader(mountParams)
Expand Down

0 comments on commit 80ad74d

Please sign in to comment.