react-native-actions-sheet
react-native-actions-sheet copied to clipboard
Any example on how to automatically open the sheet when the component mounts?
I basically need to have the sheet popup automatically as soon as the component mount.
I've managed to achieve that by adding a delay (see example below), but this is definitely not very reliable and recommended for production. It won't work without the delay.
useEffect(() => {
console.log('Ref on mount:', actionSheetRef.current); // returns null
setTimeout(() => {
actionSheetRef.current ? .show();
}, 500); // add a short delay to wait for component mount
}, []);