2

i have a question, i need make my textinput from react-native-gifted-chat make autoresize when the people is typing but i dont know how i can make this, some one have a solution for this? i tried use a nativeEvent but he dont accepted.

bellow is my code for input

interface Props {
  inputProps: React.ComponentProps<typeof InputToolbar>;
}

const ChatInput: React.FC<Props> = ({inputProps}) => {
  const theme: DefaultTheme = useContext(ThemeContext);
  return (
      <InputToolbar {...inputProps} containerStyle={chatMessageBox(theme)}/>
  );
};

export default ChatInput;

and here is my code for giftedchat

<GiftedChat
        dateFormat={'LL'}
        extraData={{appointmentColor, messagesColor}}
        infiniteScroll
        loadEarlier={shouldLoadEarlier}
        locale={getNavigatorLanguage() === 'en_US' ? 'en' : 'pt-br'}
        messages={renderMessages(messages)}
        minInputToolbarHeight={shouldShowComposer ? 70 : 0}
        minComposerHeight={Platform.OS === 'ios' ? 44 : 64}
        maxComposerHeight={100}
        onInputTextChanged={setTypedText}
        isLoadingEarlier={loadingEarlierMessages}
        onLoadEarlier={loadEarlier}
        onLongPress={onLongPress}
        onSend={(messageList: any) => {
          return messageList && sendMessage(messageList[0]);
        }}
        placeholder={t.inputPlaceholder}
        parsePatterns={parsePatterns}
        renderBubble={(props) => (
          <ChatBubble bubbleProps={props} messagesColor={messagesColor} />
        )}
        renderChatEmpty={() => <ChatEmpty translation={t} />}
        renderChatFooter={() =>
          appointment.followUpUntil ? (
            <ChatFooter
              followUpUntil={appointment.followUpUntil}
              translation={t}
            />
          ) : (
            <></>
          )
        }

0 Answers0