I have an issue when navigating into another page, its position will remain like the page before. So it won't scroll to top automatically.
I've also tried to use window.scrollTo(0, 0) on onChange router. I've also used scrollBehavior to fix this…
Since I'm using React Router to handle my routes in a React app, I'm curious if there is a way to redirect to an external resource.
Say someone hits:
example.com/privacy-policy
I would like it to redirect…
I have to implement some business logic depending on browsing history.
What I want to do is something like this:
reactRouter.onUrlChange(url => {
this.history.push(url);
});
Is there any way to receive a callback from react-router when the URL…
I have a web page with a search panel. Search panel has several input fields: id, size, ...
What I want is when user set search values (for example: id=123 and size=45) and press a search button:
searchState in Redux reducer should be updated with…
We have a list of lectures and chapters where the user can select and deselect them. The two lists are stored in a redux store.
Now we want to keep a representation of selected lecture slugs and chapter slugs in the hash tag of the url and any…
I've just started learning React and got stuck at this error.
Uncaught TypeError: Cannot read property 'pathname' of undefined
at new Router
Here is my code:
var React = require('react');
var ReactDOM = require('react-dom');
var { Route,…
I'm trying to use react router with TypeScript. However, I have certain problems using withRouter function. On the last line, I'm getting pretty weird error:
Argument of type 'ComponentClass<{}>' is not assignable to parameter of type…
I was reading react-router-redux examples and I confused,
what is the difference beetween:
import { Redirect } from 'react-router-dom'
...
and
import { push } from 'react-router-redux'
...
push('/login')
I have setup the React with react-router version 4. The routing works when I enter the URL directly on the browser, however when I click on the link, the URL changes on the browser (e.g http://localhost:8080/categories), but the content don't get…
I'm trying to deploy a create-react-app to a relative path on GitHub pages with a custom domain. E.g. www.example.com/myproject
I'm using react-router-dom, react-router-redux and react-router-bootstrap
I've set homepage to…
Goal: when loading a react-router route, dispatch a Redux action requesting asynchronic Saga worker to fetch data for the underlying stateless component of that route.
Problem: stateless components are mere functions and don't have lifecycle…
To determine the styling of specific menu item, I am trying to get the current path in my Navigation component.
I tried some of the usual suspects already, but cannot get any results. Especially properties that I thought would be injected via React…
Is it possible to call an async redux action known as a thunk on a particular route and not perform the transition until the response has succeeded or failed?
Use Case
We need to load data from the server and fill a form with initial values. These…
I am using Link component from react-router-link which applies blue color css to the text just like an anchor tag does. I want to change this to white, how can I do that?
onHover I want to change it to blue.
If I have something like this:
My routes config looks like:
export default [{
path: '/',
exact: true,
main: Home
},
{
path: '/:someId',
exact: true,
main:…