[Question] How to make TS warn me if I forget to pass Modal's props when calling NiceModal.show()
@supnate so I am basically using the Use modal with the hook pattern to show the modal as follows -
import NiceModal, { useModal } from '@ebay/nice-modal-react';
import ModalIWantToShow from './ModalIWantToShow.tsx'; // created by above code
const modalIWantToShow = useModal(ModalIWantToShow);
//...
modalIWantToShow.show({ name: 'Nate' }); // show the modal
//...
Now the problem with the above is that I may forget to pass the props while calling 'show()'. Is there a way to make sure that TS warns me if I have forgot to pass the props [because the props are not optional most of the times]??
Edit - @supnate There is another big problem with this. Let's suppose we have a modal, which initially have no props to it. Now later the requirements change and we have to add props to that modal. Now in this case someone might think, that where ever I need props TS will warn and I will add the props [especially if its a big project and the modal is being used at a lot of places]. After compiling I find there are no errors and thus I move forward. But actually whereever I used the modal with hook, I am in trouble because right now it's not warning if we don't pass props. So this is not just about 'try and remember to pass the props if using show()'. This behaviour defeats the purpose of TS altogether