title: React Js: prevent line breaks or submit on enter in the text area
body: <p>code:</p>
  
  <pre><code>const Chat = props =&gt; {
    const dispatch = useDispatch();
    const messages = useSelector(state =&gt; state.Chat);
    const [text, setText] = React.useState('');
  
    return (
      &lt;Styled.ChatBox&gt;
        &lt;Styled.ChatHeader&gt;
          &lt;p&gt;Chat Bot&lt;/p&gt;
          &lt;div&gt;
            &lt;FontAwesomeIcon icon={faAngleDown} size="1x" color="white" /&gt;
            &lt;FontAwesomeIcon icon={faTimes} size="1x" color="white" /&gt;
          &lt;/div&gt;
        &lt;/Styled.ChatHeader&gt;
        &lt;Styled.ChatLog&gt;
          {/* &lt;Styled.MessageWrapper bot={true}&gt;
            &lt;Styled.BotImg src={BotLogo} bot={true} /&gt;
            &lt;Styled.ChatMessage bot={true}&gt;
              dsasasasasasasasasasa
            &lt;/Styled.ChatMessage&gt;
          &lt;/Styled.MessageWrapper&gt; */}
          {messages.map(message =&gt; (
            &lt;Styled.MessageWrapper bot={true}&gt;
              &lt;Styled.BotImg src={BotLogo} bot={false} /&gt;
              &lt;Styled.ChatMessage bot={true}&gt;{message.text}&lt;/Styled.ChatMessage&gt;
            &lt;/Styled.MessageWrapper&gt;
          ))}
        &lt;/Styled.ChatLog&gt;
        &lt;Styled.ChatInput&gt;
          &lt;textarea
            value={text}
            onChange={e =&gt; setText(e.target.value)}
            placeholder="Digite aqui sua mensagem"
          /&gt;
          &lt;button onClick={() =&gt; dispatch(sendMessage(text))}&gt;
            &lt;FontAwesomeIcon icon={faPaperPlane} size="lg" color="black" /&gt;
          &lt;/button&gt;
        &lt;/Styled.ChatInput&gt;
      &lt;/Styled.ChatBox&gt;
    );
  };
  </code></pre>
  
  <p>Hello I'm in doubt as to how I will not allow line breaks in my textarea and clean it when the button button is pressed
  Clear the textarea field when my click event is called</p>