File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ import {
3434
3535export type ComposerEditorProps = NativeComposerEditorProps & {
3636 readonly draftKey ?: string | null ;
37+ /** iOS destroys a hidden native editor, so it remounts; the import lifecycle here survives. */
38+ readonly hidden ?: boolean ;
3739 readonly environmentId ?: EnvironmentId ;
3840 readonly onOpenMention ?: ( path : string ) => void ;
3941 readonly onOpenAttachment ?: ( attachment : ComposerDocumentAttachment ) => void ;
@@ -43,6 +45,7 @@ export type ComposerEditorProps = NativeComposerEditorProps & {
4345
4446export function ComposerEditor ( {
4547 draftKey,
48+ hidden,
4649 environmentId,
4750 onOpenMention,
4851 onOpenAttachment,
@@ -156,6 +159,7 @@ export function ComposerEditor({
156159 return (
157160 < >
158161 < NativeComposerEditor
162+ key = { hidden ? "hidden" : "visible" }
159163 { ...props }
160164 enterBehavior = { props . enterBehavior ?? preferredEnterBehavior }
161165 onChangeText = { changeText }
Original file line number Diff line number Diff line change @@ -790,7 +790,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
790790 layout = { COMPOSER_LAYOUT_TRANSITION }
791791 >
792792 < ComposerEditor
793- key = { props . hidden ? "hidden" : "visible" }
793+ hidden = { props . hidden }
794794 draftKey = { composerDraftKey }
795795 environmentId = { props . environmentId }
796796 onOpenMention = { ( path ) => {
You can’t perform that action at this time.
0 commit comments