Created
October 31, 2020 08:49
-
-
Save paulonteri/176ba62df41c1e9d591d71c168347ec6 to your computer and use it in GitHub Desktop.
Async useEffect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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