- React Router Quick Start Guide
- Sagar Ganatra
- 343字
- 2021-07-23 16:41:32
Introduction to React-Router
React-Router is a routing library for SPAs built with React. React-Router version 4 is a complete rewrite and embraces the React philosophy of component-based architecture.
This is from the React-Router documentation (https://reacttraining.com/react-router/)
React-Router can be used wherever React can be applied; that is, React-Router works both in the browser and in the native environment with React Native.
The library is divided into three packages:
- react-router: Common core components for DOM and Native versions
- react-router-dom: Components for use in browser and web applications
- react-router-native: Components for use in native applications built with React Native
The library provides various components that can be used to add routes dynamically to your application. The dynamic routing in React-Router v4 allows you to specify application routes as the user progresses through the application journey. Frameworks such as AngularJS and Express require you to specify the routes upfront, and this routing information is required when the application bootstraps. In fact, the earlier versions of React-Router followed the same paradigm and required the routing configuration to be available upfront.
Apart from dynamic routing and providing fluid navigation in a React application, the library includes various features that are available in traditional websites. These include the following:
- Navigating backward and forward through the application, maintaining the history, and restoring the state of the application
- Rendering appropriate page components when presented with a URL (deep-linking)
- Redirecting the user from one route to the other
- Support for rendering a 404 page when none of the routes match the URL
- Support for hash-based routes and pretty URLs with HTML5 mode
- 極簡(jiǎn)算法史:從數(shù)學(xué)到機(jī)器的故事
- 深入理解Django:框架內(nèi)幕與實(shí)現(xiàn)原理
- Getting Started with PowerShell
- Blender 3D Incredible Machines
- Unity UI Cookbook
- Python深度學(xué)習(xí)原理、算法與案例
- Scala for Machine Learning(Second Edition)
- Fast Data Processing with Spark(Second Edition)
- Python入門很輕松(微課超值版)
- 深入解析Java編譯器:源碼剖析與實(shí)例詳解
- 算法秘籍
- Java 9 with JShell
- Robot Framework Test Automation
- Java程序設(shè)計(jì)實(shí)用教程(第2版)
- 現(xiàn)代C++語言核心特性解析