This is the code repository for React and React Native, Fifth Edition, published by Packt.
Build cross-platform JavaScript and TypeScript apps for the web, desktop, and mobile
The authors of this book are -Mikhail Sakhniuk and Adam Boduch
Welcome to your big-picture guide to the React ecosystem.
If you’re new to React and looking to become a professional React developer, this book is for you. This updated fifth edition reflects the current state of React, including React framework coverage as well as TypeScript.
Part 1 introduces you to React. You’ll discover JSX syntax, hooks, functional components, and event handling, learn techniques to fetch data from a server, and tackle the tricky problem of state management. Once you’re comfortable with writing React in JavaScript, you’ll pick up TypeScript development in later chapters.
Part 2 transitions you into React Native for mobile development. React Native goes hand-in-hand with React. With your React knowledge behind you, you’ll appreciate where and how React Native differs as you write shared components for Android and iOS apps. You’ll learn how to build responsive layouts, use animations, and implement geolocation.
By the end of this book, you’ll have a big-picture view of React and React Native and be able to build applications with both.
- Explore React architecture, component properties, state, and context
- Work with React Hooks for handling functions and components
- Fetch data from a server using the Fetch API, GraphQL, and WebSockets
- Dive into internal and external state management strategies
- Build robust user interfaces (UIs) for mobile and desktop apps using Material-UI
- Perform unit testing for your components with Vitest and mocking
- Manage app performance with server-side rendering, lazy components, and Suspense
This unique book introduces both React and React Native, giving you a big picture view of the React ecosystem.
- Why React?
- Rendering with JSX
- Understanding React Components and Hooks
- Event Handling in the React Way
- Crafting Reusable Components
- Type-Checking and Validation with TypeScript
- Handling Navigations with Routes
- Code Splitting Using Lazy Components and Suspense
- User Interface Framework Components
- High-Performance State Updates
- Fetching Data from a Server
- State Management in React
- Server-Side Rendering
- Unit Testing in React
- Why React Native?
- React Native Under the Hood
- Kick-Starting React Native Projects
- Building Responsive Layouts with Flexbox
- Navigating between Screens
- Rendering Item Lists
- Geolocation and Maps
- Collecting User Input
- Responding to User Gestures
- Showing Progress
- Displaying Modal Screens
- Using Animations
- Controlling Image Display
- Going Offline
If you feel this book is for you, get your copy today!
This book assumes you have a basic understanding of the JavaScript programming language. It also assumes that you’ll be following along with the examples, which require a command-line terminal, a code editor, and a web browser. You’ll learn how to set up a React project in Chapter 1, Why React?. The requirements for learning React Native are the same as for React development, but to run an app on a real device, you will need an Android or iOS smartphone. In order to run iOS apps in the simulator, you will need a Mac computer. To work with Android simulator, you can use any kind of PC.
Chapter number | Software required (With version) | Free/Proprietary | If proprietary, can code testing be performed using a trial version | If proprietary, then cost of the software | Download links to the software | Hardware specifications | OS required |
---|---|---|---|---|---|---|---|
Whole book | Git | Free | Download | MacOS, Linux, Windows | |||
Whole book | Node.js | Free | Download | MacOS, Linux, Windows | |||
Coding | Visual Studio Code (VSCode) | Free | Download | MacOS, Linux, Windows | |||
React chapters | React | Free | Download | MacOS, Linux, Windows | |||
React Native chapters | XCode (for iOS), Xcode line tools (for running simulator) | Free | Yes | MacOS App Store | Apple Mac (Macbook, iMac, MacMini) | MacOS | |
React Native chapters | Android Studio (for running simulator) | Free | Yes | Download | MacOS, Linux, Windows | ||
React Native chapters | Expo Go (Without simulator) | Free | Play Store or App Store | iPhone or any Android smartphone | iOS or Android |
You can get more engaged on the discord server for more latest updates and discussions in the community at Discord
If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost. Simply click on the link to claim your free PDF. Free-Ebook
We also provide a PDF file that has color images of the screenshots/diagrams used in this book at GraphicBundle
Mikhail Sakhniuk is a seasoned software engineer skilled in TypeScript, React, and React Native. He has a decade of broad experience in the tech industry, with a specialized focus on frontend development for the past 7 years. His professional journey includes working with startups, fintech firms, and large product companies boasting over 50 million users. Currently, Mikhail is Principal Frontend Engineer at KappaPay.
Adam Boduch has been involved in large-scale JavaScript development for nearly 15 years. Before moving to the frontend, he worked on several large-scale cloud computing products using Python and Linux. No stranger to complexity, Adam has practical experience with real-world software systems and the scaling challenges they pose.