From 5d3dc16a8c08a1d351e74efcb681c607662ca052 Mon Sep 17 00:00:00 2001 From: Gustaf Dalemar Date: Tue, 24 May 2016 15:44:35 +0200 Subject: [PATCH 1/2] Only sync the url using react-router-redux if the browser supports it --- .../roc-package-web-app-react/app/client/create-client.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/roc-package-web-app-react/app/client/create-client.js b/packages/roc-package-web-app-react/app/client/create-client.js index 5fc7856..f65573b 100644 --- a/packages/roc-package-web-app-react/app/client/create-client.js +++ b/packages/roc-package-web-app-react/app/client/create-client.js @@ -6,6 +6,7 @@ import ReactDOM from 'react-dom'; import Router from 'react-router/lib/Router'; import useRouterHistory from 'react-router/lib/useRouterHistory'; import { createHistory } from 'history'; +import { supportsHistory } from 'history/lib/DOMUtils'; import debug from 'debug'; @@ -84,7 +85,12 @@ export default function createClient({ createRoutes, createStore, mountNode }) { const { syncHistoryWithStore } = require('react-router-redux'); const store = createStore(history, window.FLUX_STATE); - history = syncHistoryWithStore(history, store); + history = syncHistoryWithStore(history, store, { + // We do not want to use adjustUrlOnReplay if the browser does + // not support the history API with pushState since this can lead + // to redirect loops https://github.com/reactjs/react-router-redux/issues/285 + adjustUrlOnReplay: supportsHistory() + }); routes = createRoutes(store); locals = { From 539cc026b39880afa16d9c0b9a4f57eab8fe062a Mon Sep 17 00:00:00 2001 From: Gustaf Dalemar Date: Tue, 24 May 2016 15:45:02 +0200 Subject: [PATCH 2/2] Updated react-router-redial to the latest version Fixes a problem in IE9. --- packages/roc-package-web-app-react/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/roc-package-web-app-react/package.json b/packages/roc-package-web-app-react/package.json index a99d88a..067e42a 100644 --- a/packages/roc-package-web-app-react/package.json +++ b/packages/roc-package-web-app-react/package.json @@ -37,7 +37,7 @@ "react-helmet": "~3.1.0", "react-redux": "~4.4.5", "react-router": "~2.3.0", - "react-router-redial": "~0.1.0", + "react-router-redial": "~0.2.1", "react-router-redux": "~4.0.2", "react-server-status": "~1.0.0", "redial": "~0.4.1",