-
How does react-router4 jump according to the judgment condition?
The logic is like this: the project default route is home component , determine whether there is address in localStorage , if not, jump to address component to select an address, and then jump to home component . In vue, I judge in created and the...
-
React uses state to pass values. State is empty after the page is refreshed.
excuse me, jump from page A to page B, pass the value with state, and state will be empty after page B is refreshed. How to solve it?
A page pass value code
render: (text, record, index) => {
const path = {
pathname: goods-deta...
-
In react. Routing settings, how to make a page component display by default?
in vue, vue-router I redirect with redireact, and the route jumps to that specified route, and the page component is displayed. When I use react, it doesn t seem to show by default when it is set up in the route. Why is that?
as shown in the fig...
-
For beginners of redux, I want to see my newly added data after clicking the Add Todo button. How to implement it?
I send dispatch, in the AddTodo.js file
import React from react
import { connect } from react-redux
import { addToCart } from .. actions cart-actions
let AddTodo = ({ dispatch }) => {
let input
return (
<div>
...
-
What is the use of withRouter and why components without withRouter are also used?
background:
some people say:
"withRouter can wrap any custom component, passing in three objects of react-router s history,location,match. there is no need to pass react-router attributes at one level. When you need to use the router attribut...
-
Every time you switch a route, a prompt pops up asking if you are sure and how to trigger it globally.
question:
this is a code from Ruan Yifeng s react-router: address: http: www.ruanyifeng.com blo. slide to the bottom
how can I put it into the overall situation through this code? Which file should I put in?
my index.js:
import $ from &qu...
-
Antd Anchor anchor point, anchor point link href can be added to the custom label, do not want to use the own style
can Anchor anchor points and anchor link href of antd be added to custom tags? you don t want to use your own style
import { Anchor } from antd ;
const { Link } = Anchor;
ReactDOM.render(
<Anchor>
<Link href="-sharpcomponent...
-
React scrolls the paging list to enter the details, and then click the back button, how can you keep the back page in the same position and state as it was before leaving?
problem description
scroll down to the second page on the original list page of the (A) page, click the list < Link to= "xxx " > to jump to the detailed (B) page, and click the back button on the (B) page to execute this.props.history.goBack () ...
-
React-router 4.x nested routes cannot be displayed
items are built using creat-react-app I have configured Home and Account two child routes in index.js,
ReactDOM.render(
<HashRouter>
<Switch>
<Route exact path=" home" component={Home} >
<Route...
-
React-router 4.x nested routes cannot be displayed
items are built using creat-react-app I have configured Home and Account two child routes in index.js,
ReactDOM.render(
<HashRouter>
<Switch>
<Route exact path=" home" component={Home} >
<Route...
-
How does react realize the routing jump by clicking on the element?
use hashRouter , click on the tag to set the currently selected tag through redux , and then use what method to perform route redirection? Is there a push method like vue?
<Tag
color={this.props.tag === tag.name ? green : orange }
key={...
-
How does react set the default route?
now you want to set articesList as the default route. Click the article tag in AppSider to go to articlesList route, and click on the article in ArticlesList to enter articleDetail Route App.js .
<Layout className="app-container"...