React Cookbook
Create dynamic web apps with React using Redux, Webpack, Node.js, and GraphQL
Carlos Santana Roldan
BIRMINGHAM - MUMBAI
React Cookbook
Copyright 2018 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 author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been 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.
Commissioning Editor: Kunal Chaudhari
Acquisition Editor: Larissa Pinto
Content Development Editor: Francis Carneiro
Technical Editor: Diksha Wakode
Copy Editor: Safis Editing
Project Coordinator: Alinka Dias
Proofreader: Safis Editing
Indexer: Pratik Shirodkar
Graphics: Jason Monteiro
Production Coordinator: Arvindkumar Gupta
First published: August 2018
Production reference: 1290818
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78398-072-7
www.packtpub.com
mapt.io
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Why subscribe?
Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Mapt is fully searchable
Copy and paste, print, and bookmark content
PacktPub.com
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at service@packtpub.com for more details.
At www.PacktPub.com , you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Contributors
About the author
Carlos Santana Roldan is a senior web developer with more than 11 years of experience. Currently, he is working as a React Technical Lead in Disney ABC Television Group. He is the founder of Codejobs.com, one of the most popular developer communities in Latin America, training people in web technologies such as React, Node.js, and JavaScript.
I would like to express my deepest appreciation and special gratitude to all those from the Packt Editorial team who helped me complete this book, especially Francis Savio Carneiro, Larissa Pinto, and Diksha Wakode.
I'd also like to thank Adrian Aguirre and Tony Guerrero for all the help in the book. Finally, my deepest thanks to my wife, Cristina Rojas, for the support; my parents, Francisco Santana and Thelma Roldan, who have supported me in my professional growth; and my friends and family who helped manifest the book.
About the reviewer
Mayur Tanna is a senior IT consultant working with CIGNEX Datamatics. He has worked on various high-value projects with international clients such as World Bank and the United Nations and played a key role in creating the architecture of those projects using the latest technologies, including React, Angular, Node.js, MongoDB, Spring Boot, Firebase, Amazon Web Services, and Google Cloud Platform. Mayur is the co-author of the book Serverless Web Applications with React and Firebase. He holds a master's degree in Computer Applications and has trained lot of engineering students through tech workshops. In his free time, he plays table tennis and cricket.
I want to thank my wife, Dr. Purna, my parents, Mr. Ratilal and Mrs. Nirmala, my li'l child, Dhyey, and the rest of my family, who have supported and encouraged me in spite of all the time it took me away from them. Without their support, the review of this book would not have been possible. I would also like to thank the Packt team for giving me the opportunity to review this book.
Packt is searching for authors like you
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
To the memory of my two grandmothers, Maria Concepcin Carrillo, and Ana Mara Ochoa, t o my mother, Thelma C. Roldn, and my father Francisco Santana, for their sacrifices and for exemplifying the power of determination and dedication.
Carlos Santana Roldn
Preface
Nowadays exists tons of JavaScript libraries, frameworks, and tools for Web development. However, we should evaluate each technology to see if it fits for our project requirements. That's why I want to introduce to you React, one of the most powerful libraries to create dynamic UIs. Right now is the most popular library (not a framework) made by Facebook. I have worked with others JS frameworks such as AngularJS (also the new versions Angular 2, 4, 5), Backbone.js, Ember, and Vue.js in different projects but I can tell you that using React I enjoy more to developing new Web applications.
React has changed the way of doing Web applications and combined with Redux, we get a powerful frontend architecture that makes sense not only to experienced developers but also to those who're just starting their frontend journey.
The book introduces all the tools and best practices of React in simple recipes easy to follow, all of the recipes in this book are 100% practical and each one has the necessary code to understand all the important things.
Welcome to a better future and have fun reading and learning from this book.
Who this book is for
The book can be used by any developer who has a basic knowledge of building web applications. Mainly for JavaScript developers but not limited to any other type of devs.
Next page