Named 'hasError' prop explicitly on import, avoiding being in the rest properties (#204)

This commit is contained in:
Sam Keen 2022-04-04 15:06:12 +01:00 committed by GitHub
parent c7bc44f74a
commit 8fd1d00474
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,7 +61,7 @@ export const inputStyle = ({
: style;
export const Input = forwardRef<HTMLInputElement, InputProps>(
({ prependIconName, appendIconName, className, ...props }, ref) => {
({ prependIconName, appendIconName, className, hasError, ...props }, ref) => {
className = `h-28 ${className}`;
if (prependIconName) {
className += ' pl-28';
@ -73,7 +73,7 @@ export const Input = forwardRef<HTMLInputElement, InputProps>(
<input
{...props}
ref={ref}
className={classNames(inputClassNames({ className, ...props }))}
className={classNames(inputClassNames({ className, hasError }))}
/>
);
const iconName = prependIconName || appendIconName;