O'Reilly logo

React Native By Example by Richard Kho

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

Saving updates

As we aren't using a navigation bar with the Android version of the app, we should create a Save button that handles the same save logic.

First, we should modify index.android.js to pass a saveCurrentEditedTask prop to EditTask from the TasksList component:

// index.android.js... class Tasks extends Component {   ...   _renderScene (route, navigator) {     ...     if (route.index === 1) {       return (         <EditTask           ...           saveCurrentEditedTask={ route.passProps          .saveCurrentEditedTask }           ...         />       )     }   } } 

Then, modify TasksList to pass the _saveCurrentEditedTask method to EditTask in _renderAndroidEditTaskComponent:

// Tasks/app/components/TasksList/index.js ... export default class TasksList extends Component {   ...  _renderAndroidEditTaskComponent ...

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