A Cross Platform(Android, iOS & Web) ActionSheet with a flexible api, native performance and zero dependency code for react native. Create anything you want inside ActionSheet.
I'm currently using this library with the SheetManager in typescript, but i found it's typing can be improved. these are the things that i think can be improved:
you can put any string to id parameter in the show function, it should not, it should only accept registered id.
the payload type in options should depends on the payload of the sheet component that registered with the given id, not just by defining generic on the show function.
it just feel weird and "disconnected" when you need to import registerSheet to register a sheet, but use SheetManager to show and hide it.
The only thing that i also want to improve is to make the payload parameter in the show function become required if only the sheet component with the id argument have required parameter on it's payload, but i don't know how to do it (i don't even know if it's possible 😅)
I want to make a pull request to make it the default behavior, but i never contribute to a library code nor any open source code, so i think it's just better for me to create this issue.
I'm currently using this library with the
SheetManager
in typescript, but i found it's typing can be improved. these are the things that i think can be improved:id
parameter in theshow
function, it should not, it should only accept registeredid
.payload
type inoptions
should depends on thepayload
of the sheet component that registered with the givenid
, not just by defining generic on theshow
function.registerSheet
to register a sheet, but useSheetManager
to show and hide it.So i already creating a solution for all of those problem, which you can see here (https://gist.github.com/prs-wjy/d92e44e026b0f93c95cae0e0d0e913df).
The only thing that i also want to improve is to make the
payload
parameter in theshow
function become required if only the sheet component with theid
argument have required parameter on it's payload, but i don't know how to do it (i don't even know if it's possible 😅)I want to make a pull request to make it the default behavior, but i never contribute to a library code nor any open source code, so i think it's just better for me to create this issue.
What do you guys think?