diff --git a/src/lib/components/inputs/basic/Input.tsx b/src/lib/components/inputs/basic/Input.tsx index 112324ca..d0d49c49 100644 --- a/src/lib/components/inputs/basic/Input.tsx +++ b/src/lib/components/inputs/basic/Input.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React, { useEffect, useState } from 'react' import { isEmpty } from '../../../helpers/general' import { InputProps } from './shared' import { Checkbox } from '../Checkbox' @@ -31,7 +31,6 @@ const InputVariant: React.FC = (props) => { } export const Input = (props: InputProps) => { - verifyRequiredProps(props) const theme = useTheme() const styles = { @@ -82,7 +81,13 @@ export const Input = (props: InputProps) => { } } - const inputProps: InputProps = { ...props, inputStyles: styles } + verifyRequiredProps(props) + + const [inputProps, setInputProps] = useState({ ...props, inputStyles: styles }) + + useEffect(() => { + setInputProps({ ...props, inputStyles: styles }) + }, [props]) return ( diff --git a/src/lib/components/inputs/basic/text/Text.tsx b/src/lib/components/inputs/basic/text/Text.tsx index 685ad2de..a9b3914f 100644 --- a/src/lib/components/inputs/basic/text/Text.tsx +++ b/src/lib/components/inputs/basic/text/Text.tsx @@ -21,7 +21,7 @@ export const Text = (props: InputProps) => { }, [validationResponse]) useEffect(() => { - console.log({log: 'roso', props}) + console.log({ log: 'roso', props }) setValidationResponse(props.value) }, [props])