react 开发书籍,2016新版。Get a practical introduction to React Native, the JavaScript framework for writing and deploying fully featured mobile apps that look and feel native. With this hands-on guide, you'll learn how to build applications that target iOS, Android, and other mobile platforms instead of Learning react nativeBuilding Mobile applications with JavascriptBonnie eisenmanBeijing: Boston. Farnham. Sebastopol. Tokyo OREILLYLearning react nativeby bonnie eisenmanCopyright o 2016 Bonnie Eisenman. All rights reservedPrinted in the United states of americaPublished by o reilly Media, Inc, 1005 Gravenstein Highway North, Sebastopol, CA954OReilly books may be purchased for educational, business, or sales promotional use. Online editions arealsoavailableformosttitles(http://safaribooksonline.com).Formoreinformationcontactourcorporateinstitutionalsalesdepartment800-998-9938orcorporate@oreilly.comEditor: Meg FoleyIndexer: Ellen Troutman-ZaigProduction editor: Nicholas adamsInterior Designer: David FutatoCopyeditor: Jasmine kwitynCover Designer: Randy ComerProofreader: Christina edwardsIllustrator: Rebecca DemarestDecember 2015First editionRevision History for the First Edition2015-12-01: First ReleaseSeehttp://oreilly.com/catalog/errata.csp?isbn=9781491929001forreleasedetailsThe O Reilly logo is a registered trademark of O'Reilly Media, InC. Learning React Native, the cover image,and related trade dress are trademarks of o reilly media, IncWhile the publisher and the author have used good faith efforts to ensure that the information andinstructions contained in this work are accurate, the publisher and the author disclaim all responsibilityfor errors or omissions, including without limitation responsibility for damages resulting from the use ofor reliance on this work. Use of the information and instructions contained in this work is at your ownrisk. If any code samples or other technology this work contains or describes is subject to open sourcelicenses or the intellectual property rights of others, it is your responsibility to ensure that your usethereof complies with such licenses and/ or rights978-1-491-92900-1ILSITable of contentsPreface1. What Is react native?Advantages of React NativeDeveloper ExperienceCode reuse and knowledge SharingRisks and drawbacksSummary2. Working with React Native112344779How Does react native Work?Rendering LifecycleCreating Components in React Native10Working with Views10Using sx12Styling Native Components13Host platform apis14ummary143. Building Your First Application15Setting Up Your Environment15Installing React Native16iOS Dependencies16Android Dependencies16Creating a New ApplicationRunning a React Native Application for iOS21Uploading to Your iOS Device22Running a react Native Application for Android25Recap: Creating and Running Projects26Exploring the sample codeAttaching a Component to the view26Imports in react native27The FirstProject Component28Building a Weather App29Handling User Input31Displaying Data33Adding a Background Image37Fetching Data from the WebPutting It Together41Summary454. Components for Mobile........鲁。鲁·鲁·鲁。鲁。·鲁。。。鲁鲁鲁非··鲁·鲁47Analogies Between HTML Elements and Native ComponentsThe Text Component48The Image Component50Working with Touch and Gestures52Using Touchablehighlight52The Gesture Responder system55PanResponder58Working with Organizational Components64USing list view64Using Navigators73Other Organizational componentsPlatform-Specific ComponentiOS-or Android-Only Components76Components with Platform-Specific VersionsWhen to Use Platform-Specific ComponentsSummary81Declaring and Manipulating Styles83Inline styles84Styling with objects85Using Stylesheet. Create85Style concatenation86Organization and Inheritance87Exporting Style objects87Passing Styles as Props89Reusing and sharing styles89Positioning and Designing Layoutsiv Table of ContentsLayouts with Flexbox90USing Absolute Positioning95PuttingIt Together96ummary1006. Platform apls101Using Geolocation102Getting the User's Location102Handling permissions103Testing geolocation In the iOS Simulator104Watching the Users Location105Limitations105Updating the weather application105Accessing the Users Images and Camera108The Cameraroll module108Requesting images with GetPhoto Params110Rendering an Image from the Camera roll111Displaying a list of Photos112Uploading an image to a Server117Storing persistent data with AsyncStore118Other Storage options119The Smarter Weather Application119The Weather Project Component121The Forecast Component124The Button Component125The Location Button Component126The PhotoBackdrop Component127Summary1307. Modules131Installing JavaScript Libraries with npm131Native Modules for ioS133Including a Third-Party component133Using the video component136Anatomy of an Objective-C Native Module136Implementation of rctvideo139Native Modules for Android141Installing a Third-Party Component141Anatomy of a Java Native module146Android Implementation of Linear Gradient149Cross-Platform Native Modules151Summar153Table of contents8. Debugging and Developer Tools.................Java Script Debugging Practices, Translated155Activating the Developer Options155Debugging with console. lo156Using the JavaScript Debugger158Working with the React Developer Tools159React Native Debugging Tools161Using Inspect Element161The Red Screen of death162Debugging Beyond JavaScript166Common Development Environment issues167Common Xcode problems167Common Android Problems169The React Native Packager170Issues Deploying to an iOS Device170Simulator behavior172Testing Your Code173Type-Checking with Flc173Testing with Je173When youre stuck175Summary1759. Putting It All TogetherThe Flashcard application177Project structure180Component hierarchy181Modeling and Storing Data185Data flow architecture. reflux and flux187Using Reflux in Zebreto190Persistence, AsyncStorage, and the Reflux Stores192Using the navigator194A Look at Third-Party Dependencies197Responsive design and Font sizes198Summary and homework20010. Deploying to the ios app store∴203Preparing your Xcode project203Selecting Supported Devices and Target iOS Version204Launch Screen images205Adding Your Application Icon207Setting Your Bundle Name209Updating AppDelegate m209Table of contentsSet schema for release210Uploading Your Applicati21Getting Your Paperwork in Order212Creating an Archive214Creating an App in iTunes Connect216Bta Testing with Test Flightg220Submitting the application for review221Summary22211. Deploying Android Applications..... .................. 225Setting Application Icon225Building the apk for release227Distributing via Email or Other Links229Submitting Your application to the Play store230Beta Testing via the play store232Play Store listing233Required Assets for the Store Listing234Publishing Your application235Summary236237A. ES6 Syntax239B. Commands and Quickstart guide243Index245ole of contents|ⅶi