Sanjeev Mishra
Sanjeev Mishra

Reputation: 1

Property 'FlowbiteInstances' does not exist on type 'Window & typeof globalThis'

I am creating a multiple modals (one for each row of a table in a loop) where each modal should be shown on click event of its own "View" button. In my case, its always the last Modal that opens no matter which View button I click.

To solve this, I tried to add an "id" to each modal and declared a viewDocument(documentId) function on click event of each the View button passing ID of the corresponding modal. The implementation of viewModal has the following line to grap the instance of the modal with its ID and call show() on it:

const viewDocument = (documentId: string) => () => {
    window.FlowbiteInstances.getInstance('Modal', documentId).show();
};

However, I get the following compiler error:

Property 'FlowbiteInstances' does not exist on type 'Window & typeof globalThis'.

How should I fix this? Any help will be appreciated.

Upvotes: 0

Views: 12

Answers (0)

Related Questions