Issue: I am trying to create a function that can take a component as the first argument and its props as the second argument in a generic manner
import Modal from "./Modal.svelte";
function openModal(component: typeof Modal, componentProps: ConstructorParameters<typeof Modal>['0']['props']) {
/** Do some actions*/
}
openModal(Modal, { showModal: true })
The current implementation works, but it lacks generality. I am struggling to determine the correct generic types to use
I have experimented with
T extends SvelteComponent, T extends Svelte2TsxComponent
as possible solutions