fix: add useEffect to keep inputValue in sync

This commit is contained in:
Derrick Hammer 2023-10-16 18:07:35 -04:00
parent 29e95dba6d
commit 2c93feb022
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 0 deletions

View File

@ -156,6 +156,10 @@ export function Navigator() {
}
}, [contextUrl, setUrl]);
useEffect(() => {
setInputValue(contextUrl); // Update local state when context's url changes
}, [contextUrl]);
const NavInput = forwardRef((props: any, ref) => (
<Input ref={ref} {...props}></Input>
));