Check before setting input value

This commit is contained in:
Justin Edmund 2022-12-24 05:01:25 -08:00
parent 046c79a267
commit 118afed193

View file

@ -25,7 +25,7 @@ const Input = React.forwardRef<HTMLInputElement, Props>(function input(
// Change value when prop updates
useEffect(() => {
setInputValue(`${props.value}`)
if (props.value) setInputValue(`${props.value}`)
}, [props.value])
function handleChange(event: React.ChangeEvent<HTMLInputElement>) {