Check before setting input value
This commit is contained in:
parent
046c79a267
commit
118afed193
1 changed files with 1 additions and 1 deletions
|
|
@ -25,7 +25,7 @@ const Input = React.forwardRef<HTMLInputElement, Props>(function input(
|
||||||
|
|
||||||
// Change value when prop updates
|
// Change value when prop updates
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setInputValue(`${props.value}`)
|
if (props.value) setInputValue(`${props.value}`)
|
||||||
}, [props.value])
|
}, [props.value])
|
||||||
|
|
||||||
function handleChange(event: React.ChangeEvent<HTMLInputElement>) {
|
function handleChange(event: React.ChangeEvent<HTMLInputElement>) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue