React Router Quick Start Guide: Routing in React applications made easy
暫譯: React Router 快速入門指南:簡化 React 應用程式的路由設定
Sagar Ganatra
- 出版商: Packt Publishing
- 出版日期: 2018-09-28
- 售價: $1,470
- 貴賓價: 9.5 折 $1,397
- 語言: 英文
- 頁數: 156
- 裝訂: Paperback
- ISBN: 1789532558
- ISBN-13: 9781789532555
-
相關分類:
React
海外代購書籍(需單獨結帳)
商品描述
Learn how you can implement routing in a React Web/Native application using React-Router library
Key Features
- Create nested routes and complex workflows for your applications
- Learn Routing in server-side rendered applications and in Native mobile applications
- Understand how Redux bindings for React-Router works using the connected-react-router library
Book Description
React Router is the routing library for React, and it can be used in both React Web and React Native applications. This book is a simple way to get started with React Router and harness its full power for your applications.
The book starts with an introduction to React Router and teaches you how to create your first route using the React component. You will then learn about configuring your routes, passing parameters, and creating nested routes. You will be introduced to various components in React-Router and learn different configuration options available for these components. You will then see how to use the Redirect and Switch components. For even greater flexibility, you will learn about BrowserRouter, HashRouter, NativeRouter, and StaticRouter.
By the end of the book, you will have set up a project with React Router and make routing configuration work in a server-side rendered React application, a mobile application built with React Native and also understand how Redux and React-Router can be used in the same application.
What you will learn
- Create your first Route using the Route component
- Protect routes from unauthorized access by using the redirect component
- Navigate to your defined route using Link and NavLink
- Configure BrowserRouter and HashRouter using various props
- Use StaticRouter for routing in server-side rendered React applications
- Implement routing in a React Native app using react-router-native
- Using connected-react-router library with React-Router for better state management
Who this book is for
This book is for JavaScript developers who have basic knowledge of React and who want to harness the power and flexibility of React Router
Table of Contents
- Introduction to React Router 4 and Creating Your First Route
- Configuring Routes - Using Various Options in the Route Component
- Using the Link and NavLink Components to Navigate to a Route
- Using the Redirect and Switch Components
- Understanding the Core Router, and Configuring the BrowserRouter and HashRouter components
- Using StaticRouter in a Server-Side Rendered React Application
- Using NativeRouter in a React Native Application
- Redux Bindings with connected-react-router
商品描述(中文翻譯)
學習如何在 React Web/Native 應用程式中使用 React-Router 函式庫實現路由
主要特點
- 為您的應用程式創建嵌套路由和複雜的工作流程
- 學習在伺服器端渲染的應用程式和原生移動應用程式中的路由
- 了解如何使用 connected-react-router 函式庫來實現 Redux 與 React-Router 的綁定
書籍描述
React Router 是 React 的路由函式庫,可以在 React Web 和 React Native 應用程式中使用。本書是開始使用 React Router 的簡單方法,並充分發揮其在您應用程式中的強大功能。
本書首先介紹 React Router,並教您如何使用 React 組件創建您的第一個路由。接著,您將學習如何配置路由、傳遞參數以及創建嵌套路由。您將接觸到 React-Router 中的各種組件,並學習這些組件的不同配置選項。然後,您將看到如何使用 Redirect 和 Switch 組件。為了獲得更大的靈活性,您將學習 BrowserRouter、HashRouter、NativeRouter 和 StaticRouter。
在本書結束時,您將設置一個使用 React Router 的專案,並使路由配置在伺服器端渲染的 React 應用程式和使用 React Native 構建的移動應用程式中運作,還將了解如何在同一應用程式中使用 Redux 和 React-Router。
您將學到什麼
- 使用 Route 組件創建您的第一個路由
- 通過使用 redirect 組件來保護路由免受未授權訪問
- 使用 Link 和 NavLink 導航到您定義的路由
- 使用各種屬性配置 BrowserRouter 和 HashRouter
- 在伺服器端渲染的 React 應用程式中使用 StaticRouter 進行路由
- 在 React Native 應用程式中使用 react-router-native 實現路由
- 使用 connected-react-router 函式庫與 React-Router 進行更好的狀態管理
本書適合誰
本書適合具有基本 React 知識的 JavaScript 開發者,並希望利用 React Router 的強大功能和靈活性。
目錄
- React Router 4 介紹及創建您的第一個路由
- 配置路由 - 在 Route 組件中使用各種選項
- 使用 Link 和 NavLink 組件導航到路由
- 使用 Redirect 和 Switch 組件
- 理解核心路由器,並配置 BrowserRouter 和 HashRouter 組件
- 在伺服器端渲染的 React 應用程式中使用 StaticRouter
- 在 React Native 應用程式中使用 NativeRouter
- 使用 connected-react-router 進行 Redux 綁定