fix: add useEffect to keep inputValue in sync
This commit is contained in:
parent
29e95dba6d
commit
2c93feb022
|
@ -156,6 +156,10 @@ export function Navigator() {
|
||||||
}
|
}
|
||||||
}, [contextUrl, setUrl]);
|
}, [contextUrl, setUrl]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setInputValue(contextUrl); // Update local state when context's url changes
|
||||||
|
}, [contextUrl]);
|
||||||
|
|
||||||
const NavInput = forwardRef((props: any, ref) => (
|
const NavInput = forwardRef((props: any, ref) => (
|
||||||
<Input ref={ref} {...props}></Input>
|
<Input ref={ref} {...props}></Input>
|
||||||
));
|
));
|
||||||
|
|
Loading…
Reference in New Issue