Fix SolidityAddressInput value not displayed properly (#4428)
## Problem solved
Short description of the bug fixed or feature added
<!-- start pr-codex -->
---
## PR-Codex overview
This PR improves the handling of local input state in the `AddressInput` component by introducing a new local state variable `_localInput`.
### Detailed summary
- Introduces `_localInput` state variable using `useState`
- Modifies `localInput` assignment logic to consider `_localInput`
- Updates usage of `localInput` in the component to reflect the changes
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
This commit is contained in:
@@ -14,8 +14,9 @@ export const SolidityAddressInput: React.FC<SolidityInputProps> = ({
|
||||
}) => {
|
||||
const { name, ...restOfInputProps } = inputProps;
|
||||
const inputName = name as string;
|
||||
const [_localInput, setLocalInput] = useState<string | undefined>();
|
||||
const inputNameWatch = form.watch(inputName);
|
||||
const [localInput, setLocalInput] = useState(inputNameWatch);
|
||||
const localInput = _localInput === undefined ? inputNameWatch : _localInput;
|
||||
const address = useActiveAccount()?.address;
|
||||
|
||||
const ensQuery = useEns(localInput);
|
||||
|
||||
Reference in New Issue
Block a user