Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Getting Started with React Native

You're reading from   Getting Started with React Native Learn to build modern native iOS and Android applications using JavaScript and the incredible power of React

Arrow left icon
Product type Paperback
Published in Dec 2015
Publisher
ISBN-13 9781785885181
Length 172 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Adding images to notes


Our note-taking application is shaping up nicely, but a picture is worth a thousand words, so wouldn't it be nice if we could take a photo and store it with a note? Since React Native does not ship with a camera component, we'll need to use a very popular component created by Lochlan Wansbrough. The source code can be found at: https://github.com/lwansbrough/react-native-camera.

At this point, you are most likely familiar with the addition of new screens to our navigation. Let's quickly write the navigation code for the CameraScreen before we include the Native Module. In the NavigationBarRouteMapper, add the camera route to the LeftButton and Title attributes:

var NavigationBarRouteMapper = {
  LeftButton: function(route, navigator, index, navState) {
    switch (route.name) {
      case 'home':
        return (
          <SimpleButton
            onPress={() => navigator.push({name: 'noteLocations'})}
            customText='Map'
            style={styles.navBarLeftButton...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image