Fix controlled component warning
Mm right, when we first render the output, `imageUrl` is `undefined`, so the output textbox renders with `value={undefined}`, which is an "uncontrolled" component that the DOM is free to change. In practice, this isn't an issue because the textbox has `isReadOnly`, so the user can't _actually_ change it. But it's still a good idea for consistency and clarity to use an empty string instead of `undefined`, and it removes warning spam from my console!
This commit is contained in:
parent
f9f8cdc553
commit
a08f4e3bd1
1 changed files with 1 additions and 1 deletions
|
@ -156,7 +156,7 @@ function SingleImageConverter() {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const imageUrl = data?.outfit?.imageUrl;
|
const imageUrl = data?.outfit?.imageUrl || "";
|
||||||
|
|
||||||
const previewBackground = useColorModeValue("gray.200", "whiteAlpha.300");
|
const previewBackground = useColorModeValue("gray.200", "whiteAlpha.300");
|
||||||
const spinnerSize = useBreakpointValue({ base: "md", md: "sm" });
|
const spinnerSize = useBreakpointValue({ base: "md", md: "sm" });
|
||||||
|
|
Loading…
Reference in a new issue