colorfy-software / react-native-modalfy

🥞 Modal citizen of React Native.
https://colorfy-software.gitbook.io/react-native-modalfy
MIT License
1.16k stars 48 forks source link

Is it possible to make `params` non-undefined? #135

Open bezenson opened 11 months ago

bezenson commented 11 months ago

If I described params in react-native-modalfy.d.ts - it means that they are required for my modal. Is it possible to have an error if I call openModal() without params if my modal require them? Because currently I have to check each param in modal like params?.title, params?.items etc. but it makes no sense.

CharlesMangwa commented 8 months ago

hey @bezenson! you're making a valid point here indeed. without having thought too much about it, i believe this would require a refactoring of how params is typed here: https://github.com/colorfy-software/react-native-modalfy/blob/e9d81c8ec591d509c48e2eeaf4004b533bc5c0dd/src/types.ts#L132

until i manage to find some more time to work on this, any pull request would be more than welcome.