import axios from "axios"; //Check this for more information

const [user, SetUser] = useState({
  name = "",
  username = "",
  email = "",
});

const { name, username, email } = user;

const onInputChange = (e) => {
  setUser({ ...user, [e.target.name]: e.target.value }); //This will append info when type
}

const onSubmit = async (e) => {
  e.preventDefault(); //This will prevent showing info in url.
  await axios.post("https://localhost:8080/user") //Link to backend server
  //We use async and await here to guarantee get the data before submit.
};

<form onSubmit = {(e) => onSubmit(e)}>
  <input
	value={name}
	onChange={(e) => onInputChange(e)}
	/>
</form>