diff --git a/src/view/com/composer/GifAltText.tsx b/src/view/com/composer/GifAltText.tsx index 052b3569f2..a60956794a 100644 --- a/src/view/com/composer/GifAltText.tsx +++ b/src/view/com/composer/GifAltText.tsx @@ -55,7 +55,7 @@ export function GifAltText({ }, [linkProp]) const parsedAlt = parseAltFromGIFDescription(link.description) - const altTextRef = React.useRef('') + const [altText, setAltText] = useState(parsedAlt.alt) if (!gif || !params) return null @@ -97,12 +97,13 @@ export function GifAltText({ { - onSubmit(altTextRef.current) + onSubmit(altText) }} Portal={Portal}> + altText: string + setAltText: (text: string) => void control: DialogControlProps link: AppBskyEmbedExternal.ViewExternal params: EmbedPlayerParams }) { const t = useTheme() const {_, i18n} = useLingui() - const [altText, setAltText] = useState(altTextRef.current) return ( @@ -142,7 +144,6 @@ function AltTextInner({ label={_(msg`Alt text`)} placeholder={link.title} onChangeText={text => { - altTextRef.current = text setAltText(text) }} value={altText}