Pass location to trigger rerender. This is advised by react-router docs

This commit is contained in:
Tom Moor
2017-10-31 18:24:00 -07:00
parent 507251cfe4
commit 79f6d3b3ec
5 changed files with 10 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
// @flow
import React from 'react';
import { withRouter } from 'react-router-dom';
import type { Location } from 'react-router-dom';
import { Helmet } from 'react-helmet';
import styled from 'styled-components';
import { observer, inject } from 'mobx-react';
@@ -30,6 +31,7 @@ import DocumentsStore from 'stores/DocumentsStore';
type Props = {
history: Object,
location: Location,
collections: CollectionsStore,
documents: DocumentsStore,
children?: ?React.Element<any>,
@@ -139,6 +141,7 @@ type Props = {
<LinkSection>
<SidebarCollections
history={this.props.history}
location={this.props.location}
activeDocument={documents.active}
onCreateCollection={this.handleCreateCollection}
activeDocumentRef={this.scrollToActiveDocument}

View File

@@ -2,6 +2,7 @@
import React, { Component } from 'react';
import { observable } from 'mobx';
import { observer, inject } from 'mobx-react';
import type { Location } from 'react-router-dom';
import Flex from 'shared/components/Flex';
import styled from 'styled-components';
import { color, fontWeight } from 'shared/styles/constants';
@@ -20,6 +21,7 @@ import { type NavigationNode } from 'types';
type Props = {
history: Object,
location: Location,
collections: CollectionsStore,
documents: DocumentsStore,
activeDocument: ?Document,