Skip to content

Instantly share code, notes, and snippets.

@dceddia

dceddia/App.js

Created Jun 15, 2018
Embed
What would you like to do?
Render the Camera, or the last photo.
render() {
const { photo } = this.state;
return (
<View style={{ flex: 1, width: '100%' }}>
{photo ? (
<ImageBackground
style={{ flex: 1 }}
source={{ uri: photo.uri }} />
) : (
<Camera
style={{ flex: 1 }}
onPress={this.takePicture}
type={Camera.Constants.Type.back}
ref={cam => this.camera = cam}>
<TouchableOpacity
style={{ flex: 1 }}
onPress={this.takePicture}/>
</Camera>
)}
</View>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.