diff options
author | eug-vs <eug-vs@keemail.me> | 2021-03-26 02:29:54 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2021-03-26 02:29:54 +0300 |
commit | 907da06c18b8219f774459f7810116009709e0c1 (patch) | |
tree | d7666ee99e962c8dc8fdfdab302c49233383186d /src/components/Input.tsx | |
parent | b39bdd64e00f368a06a83d0fd2de80c6eb89c875 (diff) | |
download | commercel-ui-907da06c18b8219f774459f7810116009709e0c1.tar.gz |
fix: use state instead of refs
Diffstat (limited to 'src/components/Input.tsx')
-rw-r--r-- | src/components/Input.tsx | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/components/Input.tsx b/src/components/Input.tsx index 298d14c..a8a6f31 100644 --- a/src/components/Input.tsx +++ b/src/components/Input.tsx @@ -3,19 +3,17 @@ import { Field } from 'formik'; export interface Props extends React.InputHTMLAttributes<HTMLInputElement> { label?: string; - ref?: React.Ref<HTMLInputElement> } const focusStyles = 'focus:outline-none focus:shadow focus:border-gray-400'; const baseStyles = 'p-2 border bg-white border-gray-300 rounded-sm'; -const InputBase: React.FC<Props> = ({ label, ref, ...props }) => { +const InputBase: React.FC<Props> = ({ label, ...props }) => { return ( <div className="m-2 mb-4 flex flex-col"> <label htmlFor={props?.name} className="mb-1 text-sm text-gray-600">{label}</label> <input id={props?.name} - ref={ref} placeholder={label} className={`${baseStyles} ${focusStyles}`} {...props} |