React Native Cookbook.pdf

(32598 KB) Pobierz
React Native Cookbook
Take your React Native application development to the next
level with this large collection of recipes
Stan Bershadskiy
Crysfel Villa
BIRMINGHAM - MUMBAI
React Native Cookbook
Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or
transmitted in any form or by any means, without the prior written permission of the
publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the
information presented. However, the information contained in this book is sold without
warranty, either express or implied. Neither the authors, nor Packt Publishing, and its
dealers and distributors will be held liable for any damages caused or alleged to be caused
directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
First published: December 2016
Production reference: 1161216
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78646-255-8
www.packtpub.com
Credits
Authors
Stan Bershadskiy
Crysfel Villa
Reviewer
Brice Mason
Copy Editor
Safis Editing
Project Coordinator
Ritika Manoj
Commissioning Editor
Ashwin Nair
Acquisition Editor
Shweta Pant
Content Development Editor
Arun Nadar
Technical Editor
Shivani Kiran Mistry
Proofreader
Safis Editing
Indexer
Francy Puthiry
Graphics
Jason Monteiro
Production Coordinator
Melwyn Dsa
Foreword
Web development has for a long time been about working around the various browser
quirks and use a convoluted subset of what is provided, called "best practices", in order to
build dynamic applications on a platform that has originally been designed for static pages.
Jordan Walke, a Facebook engineer, came at this problem with a different mindset: instead
of trying to make what exists work, what if we designed an ideal solution and adapt it to
make it work under the existing constraints? This is how React was born.
React introduced a lot of concepts borrowed from many fields of computer science to the
web development world. The core idea is to declare what your application should look like
at any point in time by composing components written using a real programming language.
During a hackathon, four people: Jordan Walke, Ashwin Bharambe, Lin He, and myself,
tried to use React to render native iOS components such as UIView, UIImage, and UILabel
instead of the web equivalent, <div>, <image>, and <span>. The crazy thing is that it actually
worked!
Then, our mantra became "how can we bring the best of both worlds?". From the Web, we
borrowed the fast iteration speed and the awesome developer experience with ideas like the
element inspector and redbox. Native challenged us to provide an amazing user experience
with an acute attention to detail, strong performance, and great gesture support.
As we got to a point where we used it in production and it provided value, we decided to
open source it. We knew it was going to be make some buzz, but we had no idea that it
would explode as it did. One of our big focuses was to make it a community project, and we
worked hard to get core contributors from outside of Facebook. We now have half of the
commits contributed by the community!
Zgłoś jeśli naruszono regulamin