Pass location to trigger rerender. This is advised by react-router docs
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
import React, { Component } from 'react';
|
||||
import { observable } from 'mobx';
|
||||
import { observer, inject } from 'mobx-react';
|
||||
import { Redirect } from 'react-router-dom';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Link, Redirect } from 'react-router-dom';
|
||||
import styled from 'styled-components';
|
||||
import { newDocumentUrl } from 'utils/routeHelpers';
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import styled from 'styled-components';
|
||||
import { observable } from 'mobx';
|
||||
import { observer, inject } from 'mobx-react';
|
||||
import { withRouter, Prompt } from 'react-router-dom';
|
||||
import type { Location } from 'react-router-dom';
|
||||
import keydown from 'react-keydown';
|
||||
import Flex from 'shared/components/Flex';
|
||||
import { color, layout } from 'shared/styles/constants';
|
||||
@@ -42,7 +43,7 @@ Are you sure you want to discard them?
|
||||
type Props = {
|
||||
match: Object,
|
||||
history: Object,
|
||||
location: Object,
|
||||
location: Location,
|
||||
keydown: Object,
|
||||
documents: DocumentsStore,
|
||||
collections: CollectionsStore,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import { Redirect } from 'react-router-dom';
|
||||
import type { Location } from 'react-router-dom';
|
||||
import queryString from 'query-string';
|
||||
import { observable } from 'mobx';
|
||||
import { observer, inject } from 'mobx-react';
|
||||
@@ -11,7 +12,7 @@ import AuthStore from 'stores/AuthStore';
|
||||
|
||||
type Props = {
|
||||
auth: AuthStore,
|
||||
location: Object,
|
||||
location: Location,
|
||||
};
|
||||
|
||||
@observer class SlackAuth extends React.Component {
|
||||
|
||||
Reference in New Issue
Block a user