code: function useChat() {
    const [message, setMessage] = useState("");
    const [history, setHistory] = useState([]);
  
    const inputProps = {
      value: message,
      onChange: e => setMessage(e.target.value)
    };
    const addToChat = () => {
      setHistory([message, ...history]);
      setMessage("");
    };
    return { inputProps, addToChat, messages: history };
  }
docs: --------------------------------------------