I have a component called <FormComponent/> and it includes the method named onSubmit.
const FormComponent = () => {
const [input, setInput] = useState('')
const onSubmit = () => {do somthing}
<form>
<input type="text" placehold="fullName" name="full name" value={input} onChange={setInput(e.target.value)}/>
</form>
}
const app = () => {
return (
<FormComponent />
<button type="submit">Submit</button>
)
}
now I want when clicking on the button which inside App component, the onSubmit method inside the FormComponent to be executed