Prevent default form behavior.

This commit is contained in:
Chigozirim Igweamaka 2024-05-24 10:54:28 +01:00
parent a6a86eb95c
commit ddab1611b8

View file

@ -10,7 +10,8 @@ const Form = ({ socket }) => {
setFormState({ ...formState, [name]: value }); setFormState({ ...formState, [name]: value });
}; };
const submitForm = () => { const submitForm = (event) => {
event.preventDefault();
const { spotifyUrl } = formState; const { spotifyUrl } = formState;
if (spotifyURLisValid(spotifyUrl) === false) { if (spotifyURLisValid(spotifyUrl) === false) {
return; return;