Ref access from anywhere
You can access the ActionSheetRef
from anywhere in the app using SheetManager
.
SheetManager.get('example-sheet').snapToOffset(50);
You can also get ref of an action sheet in a specific SheetProvider
.
SheetManager.get('example-sheet', 'local-context').snapToOffset(50);
Ref access in components
In components, ref can be accessed with useSheetRef
hook or the ref
prop on the ActionSheet
.
const ref = useSheetRef();
ref.snapToOffset(50);
Last updated on January 29, 2024