Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

submit with data and event in child to parent

//type 
submit:(data:userSubmitForm)=>(e:React.SyntheticEvent)=>void
 
 //
submit:  (data:userSubmitForm)=>(e:React.SyntheticEvent)=>{
    e.preventDefault()
    console.log("create",data)
  }


//click event
onClick={props.submit(form)}
 
PREVIOUS NEXT
Tagged: #submit #data #event #child #parent
ADD COMMENT
Topic
Name
1+1 =