mirror of
https://github.com/zhigang1992/react-native-gifted-chat.git
synced 2026-01-12 17:42:27 +08:00
Add initialText prop (#1104)
This commit is contained in:
@@ -414,9 +414,10 @@ class GiftedChat extends React.Component {
|
||||
this.setMaxHeight(layout.height);
|
||||
const newComposerHeight = this.props.minComposerHeight;
|
||||
const newMessagesContainerHeight = this.getMessagesContainerHeightWithKeyboard(newComposerHeight);
|
||||
const initialText = this.props.initialText || '';
|
||||
this.setState({
|
||||
isInitialized: true,
|
||||
text: this.getTextFromProp(''),
|
||||
text: this.getTextFromProp(initialText),
|
||||
composerHeight: newComposerHeight,
|
||||
messagesContainerHeight: this.prepareMessagesContainerHeight(newMessagesContainerHeight),
|
||||
});
|
||||
@@ -572,6 +573,7 @@ GiftedChat.defaultProps = {
|
||||
GiftedChat.propTypes = {
|
||||
messages: PropTypes.arrayOf(PropTypes.object),
|
||||
text: PropTypes.string,
|
||||
initialText: PropTypes.string,
|
||||
placeholder: PropTypes.string,
|
||||
messageIdGenerator: PropTypes.func,
|
||||
user: PropTypes.object,
|
||||
|
||||
Reference in New Issue
Block a user