react-native-modalfy icon indicating copy to clipboard operation
react-native-modalfy copied to clipboard

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

Open bezenson opened this issue 1 year ago • 1 comments

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.

bezenson avatar Jan 04 '24 19:01 bezenson

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.

CharlesMangwa avatar Mar 08 '24 22:03 CharlesMangwa