I have two files named app.js and modal-form.js. When I click the button on the App.js component, I want a function in the modal-form.js file to be triggered. I'm new to the React library and I would appreciate it if you could help me. I hope I could explain.
Example modal-form.js
const [open, setOpen] = React.useState(false);
const handleOpen = () => {
setOpen(true);
};
Example App.js
<ModalForm ref={(ref) => this.handleOpen = ref} />
like this.