Archives : October-2016

I can’t seem to find how to update query params with react-router without using <Link/>. hashHistory.push(url) doesn’t seem to register query params, and it doesn’t seem like you can pass a query object or anything as a second argument. How do you change the url from /shop/Clothes/dresses to /shop/Clothes/dresses?color=blue in react-router without using <Link>? And ..

Read more

I am currently passing my state on route change like below: <Link to={{ pathname:`/transactions/${props.transaction.id}`, state: {transaction: props.transaction} }}> View Details </Link> My logic is that if “location.state.transaction” exists, don’t fetch new data, else, fetch data. Now the flaw is when there is a page reload. The application needs to fetch new data if the user ..

Read more

I have a React app with navigation powered by react-router that I run in development with webpack-dev-server and the history fallback option enabled. Here is the routes I have defined in my index.js ReactDOM.render(( <Router history={browserHistory}> <Route path=”/” component={App}> <IndexRedirect to=”/intro” /> <Route path=”/intro” component={Intro} /> <Route path=”/device” component={Device} /> <Route path=”/clothing” component={Clothing} /> <Route ..

Read more

I am Using react-route, and i am facing some trouble with routing. The whole page is reloading , causing all the data that i have already fetched and stored in the reducer to load every time. Here is my Route file : var CustomRoute = React.createClass({ render:function(){ return <Router history={browserHistory}> <Route path=”/” component={Layout}> <IndexRedirect to=”/landing” ..

Read more

I’m using react 15.3.1, with react-router 2.4.1 and react-router-redux 4.0.5: When I trap the routing change with: this.props.router.setRouteLeaveHook( this.props.route, this.routerWillLeave ); private routerWillLeave = () => { if (this.state.editing) return ‘You may have unsaved changes. Are you sure you want to leave?’ }; … I do get my this.routerWillLeave method called, but the URL in ..

Read more