Skip to content

Instantly share code, notes, and snippets.

@paulonteri
Created October 31, 2020 08:49
Show Gist options
  • Save paulonteri/176ba62df41c1e9d591d71c168347ec6 to your computer and use it in GitHub Desktop.
Save paulonteri/176ba62df41c1e9d591d71c168347ec6 to your computer and use it in GitHub Desktop.
Async useEffect
useEffect(() => {
(async () => {
if (Platform.OS !== "web") {
const {
status,
} = await ImagePicker.requestCameraRollPermissionsAsync();
if (status !== "granted") {
alert("Sorry, we need camera roll permissions to make this work!");
}
}
})();
}, []);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment