How to save chat in chat view component

I have created a chat app ane i want to know how to save the chat…

I would recommend to save each message by the moment sending/receiving it.


How Can I Do It?

How are you chat worls? With firebase, in firebase you texts are safed if you sent a msg depend on you file structure. But in the forum are some tutuials for making a chat. Look into them