I have two components, one for API and another for UI. I am trying to access a function from API Component in UI component like below,
import APIComponent "./APIComponent";
APIComponent.getData().(response:any) => { //showing error here as "Property 'getData' does not exist on type '{ APIComponent: () => any; }'"
console.log(response);
})
Below is my APIComponent,
const APIComponent=():any=>{
const getData=():any =>{
//forming request
}
}
Thanks in Advance.