I've made the custom InputToolbar.
My code is:
onSend = (messages = []) => {
messages.forEach(m => this.props.dispatch(sendMessage(this.chatId, m.text)))
this.setState({text: ''})
}
messages={data}
onSend={this.onSend}
renderInputToolbar={() => (
ref={component => this.messageInput = component}
multiline={true}
onChangeText={this.onInputTextChanged.bind(this)}
placeholder="Type a message here..."
/>
)}
user={{
_id: this.props.currentUserUid,
}}
/>
But I can't send the message.
Could you please help me?
If you just want to customise the Send button you can use the renderSend prop instead of renderInputToolbar, for example like this:
import Ionicons from 'react-native-vector-icons/Ionicons';
renderSend(props) {
return (
<Send {...props}>
<View style={{ marginBottom: 5, marginRight: 10 }}>
<Ionicons
name="md-send"
size={29}
/>
</View>
</Send>
);
}
{/* ... */}
<GiftedChat
renderSend={this.renderSend}
...
/>
OK, Thank you.
i want to achieve same thing as above and i actually want to change the design of text input too
@gianpaj is there a list of props somewhere like
Most helpful comment
If you just want to customise the Send button you can use the
renderSendprop instead ofrenderInputToolbar, for example like this: