react-artasys-ui 0.1.11 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-artasys-ui",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -16,7 +16,7 @@ interface IInput extends IElement<HTMLInputElement> {
16
16
  }
17
17
 
18
18
  const Input = forwardRef<HTMLInputElement, IInput>(({onChange, onInput, onChangeText, formValue, ...props}, ref) => {
19
- const [currentValue, setCurrentValue] = useState<string | undefined>('');
19
+ const [currentValue, setCurrentValue] = useState('');
20
20
 
21
21
  const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
22
22
  if (typeof onChange === 'function') {
@@ -37,7 +37,8 @@ const Input = forwardRef<HTMLInputElement, IInput>(({onChange, onInput, onChange
37
37
  };
38
38
 
39
39
  useEffect(() => {
40
- setCurrentValue(String(props.value ?? formValue));
40
+ const value = props.value ?? formValue;
41
+ setCurrentValue(value ? String(value) : '');
41
42
  }, [props.value, formValue]);
42
43
 
43
44
  return(<Element {...props}>