Skip to content

Commit

Permalink
fix(blade-old): remove unnecessary warning for Checkbox props (#546)
Browse files Browse the repository at this point in the history
  • Loading branch information
gupta-ji6 authored Jul 20, 2022
1 parent fef2735 commit 576793f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/early-mayflies-retire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@razorpay/blade-old": patch
---

fix(checkbox): remove unnecessary warning for checkbox props
4 changes: 2 additions & 2 deletions packages/blade-old/src/atoms/Checkbox/Checkbox.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ Checkbox.propTypes = {
onChange: PropTypes.func.isRequired,
testID: PropTypes.string,
helpText: (props, propName, componentName) => {
if (props.size === 'small') {
if (props.size === 'small' && props.helpText !== '') {
return new Error(
`[${propName}]. ${propName} is ignored as it is not supported when size is small in ${componentName}`,
);
Expand All @@ -243,7 +243,7 @@ Checkbox.propTypes = {
return null;
},
errorText: (props, propName, componentName) => {
if (props.size === 'small') {
if (props.size === 'small' && props.errorText !== '') {
return new Error(
`[${propName}]. ${propName} is ignored as it is not supported when size is small in ${componentName}`,
);
Expand Down
4 changes: 2 additions & 2 deletions packages/blade-old/src/atoms/Checkbox/Checkbox.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ Checkbox.propTypes = {
id: PropTypes.string,
name: PropTypes.string,
helpText: (props, propName, componentName) => {
if (props.size === 'small') {
if (props.size === 'small' && props.helpText !== '') {
return new Error(
`[${propName}]. ${propName} is ignored as it is not supported when size is small in ${componentName}`,
);
Expand All @@ -292,7 +292,7 @@ Checkbox.propTypes = {
return null;
},
errorText: (props, propName, componentName) => {
if (props.size === 'small') {
if (props.size === 'small' && props.errorText !== '') {
return new Error(
`[${propName}]. ${propName} is ignored as it is not supported when size is small in ${componentName}`,
);
Expand Down

0 comments on commit 576793f

Please sign in to comment.