Skip to content

Commit 55ca14d

Browse files
authored
Merge pull request dozoisch#102 from ahuth/on-change-strictness
Make the onChange prop not required
2 parents 1ff4eae + b8660de commit 55ca14d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/recaptcha.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export default class ReCAPTCHA extends React.Component {
118118
ReCAPTCHA.displayName = "ReCAPTCHA";
119119
ReCAPTCHA.propTypes = {
120120
sitekey: PropTypes.string.isRequired,
121-
onChange: PropTypes.func.isRequired,
121+
onChange: PropTypes.func,
122122
grecaptcha: PropTypes.object,
123123
theme: PropTypes.oneOf(["dark", "light"]),
124124
type: PropTypes.oneOf(["image", "audio"]),
@@ -130,6 +130,7 @@ ReCAPTCHA.propTypes = {
130130
badge: PropTypes.oneOf(["bottomright", "bottomleft", "inline"]),
131131
};
132132
ReCAPTCHA.defaultProps = {
133+
onChange: () => {},
133134
theme: "light",
134135
type: "image",
135136
tabindex: 0,

0 commit comments

Comments
 (0)