From d4a3375d3a9172d4fb33e6337a1498390002a461 Mon Sep 17 00:00:00 2001 From: Laurent Bossavit Date: Thu, 12 Oct 2017 16:41:00 +0200 Subject: [PATCH] =?UTF-8?q?:bug:=20Utiliser=20Router=20et=20pas=20BrowserR?= =?UTF-8?q?outer=20pour=20parler=20=C3=A0=20l'historique?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/containers/Layout.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/containers/Layout.js b/source/containers/Layout.js index add8e7414..423974def 100644 --- a/source/containers/Layout.js +++ b/source/containers/Layout.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import './Layout.css' import './reset.css' -import {Link, Route, BrowserRouter as Router, Switch} from 'react-router-dom' +import {Link, Route, Router, Switch} from 'react-router-dom' import HomeEmbauche from 'Components/HomeEmbauche' import HomeSyso from 'Components/HomeSyso' import Rule from 'Components/rule/Rule' @@ -13,8 +13,6 @@ import Results from 'Components/Results' import ReactPiwik from 'react-piwik'; import createHistory from 'history/createBrowserHistory' -const history = createHistory() - const piwik = new ReactPiwik({ url: 'stats.data.gouv.fr', siteId: 39, @@ -22,6 +20,8 @@ const piwik = new ReactPiwik({ }); export default class Layout extends Component { + history = createHistory(); + render() { let displayWarning = ['/simu/', '/regle/'].find(t => window.location.href.toString().indexOf(t) > -1) @@ -29,7 +29,7 @@ export default class Layout extends Component { ReactPiwik.push(['trackPageView']) return ( - +