diff --git a/packages/strapi-admin/admin/src/components/Webhooks/Inputs/index.js b/packages/strapi-admin/admin/src/components/Webhooks/Inputs/index.js index 0625f089d5..1f658044bd 100644 --- a/packages/strapi-admin/admin/src/components/Webhooks/Inputs/index.js +++ b/packages/strapi-admin/admin/src/components/Webhooks/Inputs/index.js @@ -46,7 +46,7 @@ function Inputs({ ) : ( {({ canCheck, error, dispatch }) => { - const hasError = error && error !== null; + const hasError = Boolean(error); const handleChange = e => { if (!canCheck) { diff --git a/packages/strapi-plugin-content-manager/admin/src/components/InputJSONWithErrors/index.js b/packages/strapi-plugin-content-manager/admin/src/components/InputJSONWithErrors/index.js index 2cec1deac7..6ac68ba165 100644 --- a/packages/strapi-plugin-content-manager/admin/src/components/InputJSONWithErrors/index.js +++ b/packages/strapi-plugin-content-manager/admin/src/components/InputJSONWithErrors/index.js @@ -44,20 +44,13 @@ class InputJSONWithErrors extends React.Component { const handleBlur = isFunction(onBlur) ? onBlur : this.handleBlur; return ( - + {({ canCheck, onBlur, error, dispatch }) => { - const hasError = error && error !== null; + const hasError = Boolean(error); return ( - {!hasError && inputDescription && ( - {inputDescription} - )} + {!hasError && inputDescription && {inputDescription}} {hasError && {error}} ); diff --git a/packages/strapi-plugin-content-manager/admin/src/components/InputUID/index.js b/packages/strapi-plugin-content-manager/admin/src/components/InputUID/index.js index 4fe0a78108..c237cd329b 100644 --- a/packages/strapi-plugin-content-manager/admin/src/components/InputUID/index.js +++ b/packages/strapi-plugin-content-manager/admin/src/components/InputUID/index.js @@ -203,7 +203,7 @@ const InputUID = ({ validations={{ ...validations, regex: UID_REGEX }} > {({ canCheck, onBlur, error, dispatch }) => { - const hasError = error && error !== null; + const hasError = Boolean(error); return ( diff --git a/packages/strapi-plugin-content-manager/admin/src/components/WysiwygWithErrors/index.js b/packages/strapi-plugin-content-manager/admin/src/components/WysiwygWithErrors/index.js index d4d806e901..21665006da 100644 --- a/packages/strapi-plugin-content-manager/admin/src/components/WysiwygWithErrors/index.js +++ b/packages/strapi-plugin-content-manager/admin/src/components/WysiwygWithErrors/index.js @@ -41,20 +41,13 @@ class WysiwygWithErrors extends React.Component { } = this.props; return ( - + {({ canCheck, onBlur, error, dispatch }) => { - const hasError = error && error !== null; + const hasError = Boolean(error); return ( @@ -86,9 +79,7 @@ class WysiwygWithErrors extends React.Component { tabIndex={tabIndex} value={value} /> - {!hasError && inputDescription && ( - {inputDescription} - )} + {!hasError && inputDescription && {inputDescription}} {hasError && {error}} );