Archives : November-2017

I am following react-router docs to create a protected route HOC and for unauthenticated requests I am Redirecting the user as following : <Redirect to={{ pathname: ‘/input-number’, state: { from: props.location }, }} /> Now on the redirected component, I show an error message using the following logic : this.props.location.state && this.props.location.state.from && ( <Grid.Row> ..

Read more

I want to rendered a NavLink with a active class when the route is the same that the current route. This is the code: <NavLink className=”nav-link-gdc” activeClassName=”nav-link-gdc-selected” to=”/home”>HOME</NavLink> The problem is that this only works when I reload the URL and I do not know how to trigger the change of the class when I ..

Read more

I’m trying to build my first portfolio website and got stuck in routing using react-router-dom 4.2.2 and styled-components 2.2.3. error message: You should not use Route or withRouter() outside a Router I also try using Link instead of NavLink but got error too(You should not use Link outside a Router) Someone help me please. navigationBar.js ..

Read more

I’ve got some problems setting up React-Router-Redux. I’m just following the basic example on https://github.com/ReactTraining/react-router/tree/master/packages/react-router-redux#usage. My App.jsx looks like this: import React, { Component } from ‘react’; import { Route, Switch } from ‘react-router-dom’; import { Provider } from ‘react-redux’; import { ConnectedRouter } from ‘react-router-redux’; import createHistory from ‘history/createBrowserHistory’; import Home from ‘./containers/Home’; import ..

Read more