In the duration of a court proceeding, having necessary evidence is necessary to prove that the other party is guilty of the legal action that the side of the prosecution filed. In the judicial process, this is called the burden of proof, and this is crucially needed.
In lawsuits involving mediated communication such as smartphones, messages could be a form of evidence if needed. However, evidences of communication obtained through mobile devices also have limitations. Wiretapping is strictly prohibited by the federal court, and recordings of calls could only be substantial if there is consent to one or both parties involved in the case.
Unlike phone calls, WhatsApp and text messages have an easier process in being presented as evidence in court. All you need to consider is that the message is relevant to the case, it is not manipulated, and it is visually clear for the judge to see.
There are ways on how you can have proper documentation of the messages you had on WhatsApp for you to have substantial evidence you can use on the lawsuit. This infographic from TeleMessage will tell you tips on archiving WhatsApp and text messages.