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:
Emi Matchu 2021-05-25 05:30:57 -07:00
parent f9f8cdc553
commit a08f4e3bd1

View file

@ -156,7 +156,7 @@ function SingleImageConverter() {
}
);
const imageUrl = data?.outfit?.imageUrl;
const imageUrl = data?.outfit?.imageUrl || "";
const previewBackground = useColorModeValue("gray.200", "whiteAlpha.300");
const spinnerSize = useBreakpointValue({ base: "md", md: "sm" });