- Features
- Business
- Explore
- Marketplace
- Pricing
This repository
or
Sign up
- Watch 3
- Star 26
- Fork 6
DigAg / digag-pc-react
Issues 4
Pull requests 0
Projects 0
Graphs
Dismiss
Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Sign up
React Practice Project (4) # 9
Issue 2 days ago · 0 comments
Comments
Contributor
Yuicon commented 2 days ago • edited
Last time, when we talked about using Redux-Saga to manage asynchronous Redux applications, the application still had only one home page. Now build a new submission page and use the React-Router for route management. React Practice Project (1) React Practice Project (2) React Practice Project (3) React Practice Project (4) – First let’s build the submission pageCreate a SRC/containers/SubmitEntry. Js
The related Redux section has been covered. I won’t repeat the introduction, but you can see the sample code if you are interested
The editor package. Json
Router: There are three routers, and we used the common browserHistory BrowserHistory H5 history hashHistory The history memoryHistory node environment of older browsers, stored in memory Route : Each Route tag corresponds to a UI page, and its job is to render the UI when the page’s access address matches the path on the Route. exact :
history: Commonly used method Push (path, [state]) adds a new entry to the history stack. Often used to jump to a page, for example: this.props.history.push(‘/’); Jump to home page Replace (PATH, [state]) replaces the current entry in the history stack. The difference between a push and a replace(path, [state]) is that it cannot return to the page before the jump through the history stack GoBack () is equivalent to the browser’s back key match: The match object contains information about how a Route matches a URL and has the following properties: Params: object path parameter that retrieves key-value pairs by parsing the dynamic part of the URL IsExact: bool Indicates true. All urls must be matched Path: string Matching path pattern, used to create nested Url: string Matching part of the URL, used for nesting There are often used to obtain the parameters in the path a routing < the Route path = “/” id “component = {Child} / > in the Child can access to this id parameter. The props. Match. Params. Id
Now that we have a human-friendly application, most of the rest is business code. To test the effect, of course, deploy to the server. The next article will introduce how to deploy React using nginx docker images. Full project code address: github.com/DigAg/digag… |
This was referenced a day ago
React Practice Project (1)# 2
React Practice Project (2)# 7
React Practice Project (3)# 8
to join this conversation on GitHub. Already have an account?
Sign in to comment
- Contact GitHub
- API
- Training
- Shop
- Blog
- About
- © 2017 lot, Inc.
- Terms
- Privacy
- Security
- Status
- Help
You signed out in another tab or window. Reload to refresh your session.