O'Reilly logo

Getting Started with React Native by Tom Bray, Ethan Holmes

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Connecting the final pieces

Now that we have CameraScreen and ImageScreen, we need to be able to navigate to them via the NoteScreen. We are going to add a button that will change the state based on the imagePath of the note. If it does not exist, then we want the user to transition to the CameraScreen and the ImageScreen when it does. Visually we are going to place the button in-line with the title input:

import SimpleButton = from './SimpleButton'; export default class NoteScreen extends React.Component { ... blurInputs () { this.refs.body.blur(); this.refs.title.blur(); } render () { var pictureButton = null; if (this.props.showCameraButton) { pictureButton = (this.state.note.imagePath) ? ( <SimpleButton onPress={() => { this.blurInputs(); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required