Submit form

FeedbackForm.js

<form onSubmit={handleSubmit}>
const handleSubmit = (e) => {
    e.preventDefault();
    if (text.trim().length > 10) {
      const newFeedback = {
        text,
        rating,
      };
      console.log(newFeedback);
    }
  };
Was this page helpful?