Skip to content

registerSheet ​

A function used to register an ActionSheet with SheetProvider.

Parameters:

id

Id for the sheet. It should be something unique and human readable. For example, confirm-sheet.

TypeRequired
stringtrue

Sheet

The component that contains the action sheet.

TypeRequired
React.ElementTypetrue

contexts

Deprecated (no-op). Extra context arguments are ignored. A registered sheet is available in every SheetProvider; choose the provider at SheetManager.show time using the context option instead.

TypeRequired
...string[]false
tsx
registerSheet("example-sheet", ExampleSheet);

TIP

A SheetProvider without a context prop has "global" context by default. When you register an action sheet, it's available in the "global" SheetProvider and any other provider you show it in.

Released under the MIT License.