From 7b2d0676609683ca9247560f44c9a0fa45662290 Mon Sep 17 00:00:00 2001 From: m7kvqbe1 Date: Mon, 16 Nov 2020 12:58:56 +0000 Subject: [PATCH] fix(ReactComponentLibrary): Do not drill `isInvalid` prop to DOM nodes --- .../src/components/Checkbox/Checkbox.tsx | 1 + .../src/components/CheckboxEnhanced/CheckboxEnhanced.tsx | 1 + packages/react-component-library/src/components/Radio/Radio.tsx | 1 + .../src/components/RadioEnhanced/RadioEnhanced.tsx | 1 + .../src/enhancers/__tests__/withFormik.test.tsx | 2 +- 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/react-component-library/src/components/Checkbox/Checkbox.tsx b/packages/react-component-library/src/components/Checkbox/Checkbox.tsx index 3818ed44bb..25e1e4b0ca 100644 --- a/packages/react-component-library/src/components/Checkbox/Checkbox.tsx +++ b/packages/react-component-library/src/components/Checkbox/Checkbox.tsx @@ -30,6 +30,7 @@ export const Checkbox = forwardRef( onBlur, onChange, value, + isInvalid, ...rest }, ref diff --git a/packages/react-component-library/src/components/CheckboxEnhanced/CheckboxEnhanced.tsx b/packages/react-component-library/src/components/CheckboxEnhanced/CheckboxEnhanced.tsx index c4446c0137..8453e819bd 100644 --- a/packages/react-component-library/src/components/CheckboxEnhanced/CheckboxEnhanced.tsx +++ b/packages/react-component-library/src/components/CheckboxEnhanced/CheckboxEnhanced.tsx @@ -14,6 +14,7 @@ export const CheckboxEnhanced: React.FC = ({ name, tabIndex = 0, title, + isInvalid, ...rest }) => { const ref = useRef(null) diff --git a/packages/react-component-library/src/components/Radio/Radio.tsx b/packages/react-component-library/src/components/Radio/Radio.tsx index b8125002da..5f4edc7dc0 100644 --- a/packages/react-component-library/src/components/Radio/Radio.tsx +++ b/packages/react-component-library/src/components/Radio/Radio.tsx @@ -28,6 +28,7 @@ export const Radio = forwardRef( onChange, onBlur, value, + isInvalid, ...rest }, ref diff --git a/packages/react-component-library/src/components/RadioEnhanced/RadioEnhanced.tsx b/packages/react-component-library/src/components/RadioEnhanced/RadioEnhanced.tsx index 3fd7850113..b56f46e69b 100644 --- a/packages/react-component-library/src/components/RadioEnhanced/RadioEnhanced.tsx +++ b/packages/react-component-library/src/components/RadioEnhanced/RadioEnhanced.tsx @@ -14,6 +14,7 @@ export const RadioEnhanced: React.FC = ({ name, tabIndex = 0, title, + isInvalid, ...rest }) => { const ref = useRef(null) diff --git a/packages/react-component-library/src/enhancers/__tests__/withFormik.test.tsx b/packages/react-component-library/src/enhancers/__tests__/withFormik.test.tsx index 1c93aadb23..5725f1756d 100644 --- a/packages/react-component-library/src/enhancers/__tests__/withFormik.test.tsx +++ b/packages/react-component-library/src/enhancers/__tests__/withFormik.test.tsx @@ -6,7 +6,7 @@ import { FieldProps } from '../../common/FieldProps' import { FormProps } from '../../common/FormProps' import { withFormik } from '../withFormik' -const DummyComponent: React.FC = (props) => ( +const DummyComponent: React.FC = ({ isInvalid, ...props }: any) => (
) const DummyFormikComponent = withFormik(DummyComponent)