how do i check if the input is clear?

All you need to do is prevent your submit function from calling firebase if your input is empty.

const sendMessage = (e) => { 
 if (input.length <= 0) return; // This will end the function here if your input is empty

     timestamp: firebase.firestore.FieldValue.serverTimestamp(),
     message: input,
     user: user,       

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top