Reputation: 3002
I am using gifted chat library in react native but the default view is to display only the avatar and the message in the bubble. I am building a group chat and I want to also display the name of the user in each bubble and the time the message was sent.
I added renderMessage(props) {...}
property and if I return here a custom View
with Text
I can display the name of the user, but I am losing all the formatting that is already made by the library.
Is there a way to toggle to show the user.name
of the message without rebuilding all the style from ground? I didn't found on the documentation something like this and I think it would be very helpful.
Upvotes: 2
Views: 2626
Reputation: 139
You can userenderUsernameOnMessage={true}
in the GiftedChat component
Upvotes: 2