Do you believe it is beneficial to organize logic into utility files and dynamically load them to enhance the speed of a website?
For example, I have a method called getInvoiceDetails
in a file named getInvoiceDetails.tsx
:
export default const getInvoiceDetails = (
eventId: string
) => {
In another component file, I import this method as follows:
const getInvoiceDetails = dynamic(
() => import("../../Utility/BuyTicket/getInvoiceDetails")
);
and then proceed to call it:
let resp = getInvoiceDetails(
eventId
However, when running yarn build
, an error is raised:
Not all constituents of type 'ComponentType<{}>' are callable.
Type 'ComponentClass<{}, any>' has no call signatures.
286 | const callInvoiceDetails = () => {
287 | callSaveData();
> 288 | let resp = getInvoiceDetails(
> Blockquote
Can you identify what might be causing this issue?