DEV Community

Discussion on: React Hooks Noob, please help...

Collapse
 
chico1992 profile image
chico1992

Do you have a code snippet or a repo you can show as without code it's pretty hard to help you
I could guess that you're using some sort of library(apollo) for graphql if this is the case something like the following should work

const SubmitForm = () =>{
    const [mutation] = useMutation();
    return(
        <form onSubmit={()=>{mutation()}}>
            {/* some more components here */}
        </form>
    );
}

this is in no way working code but the usage should be clear