I want to write an application with Laravel, React and Antd. I have two files “People.jsx” and “PersonForm.jsx”. First one is the page, the second one is the form, that is included in the first one. The idea is, that after pressing a button, a modal opens up, presented with a form to add a new person to the database.
And now I have two options to actually trigger the functions that will be talking to the API. Option one, I use the modal button “OK” in the main file, that will read the data from the form (child element) and interact with the API. Option two, I use the “submit” button of the form itself, to trigger the functions in the parent object.
Are these two options equal, or do I miss something?