Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use named import of 'history' module to fix #5576. #5589

Merged
merged 2 commits into from
Nov 13, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/react-router-dom/modules/BrowserRouter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import warning from 'warning'
import React from 'react'
import PropTypes from 'prop-types'
import createHistory from 'history/createBrowserHistory'
import {createBrowserHistory as createHistory} from 'history'
import Router from './Router'

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-dom/modules/HashRouter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import warning from 'warning'
import React from 'react'
import PropTypes from 'prop-types'
import createHistory from 'history/createHashHistory'
import {createHashHistory as createHistory} from 'history'
import Router from './Router'

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router/modules/MemoryRouter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import warning from 'warning'
import React from 'react'
import PropTypes from 'prop-types'
import createHistory from 'history/createMemoryHistory'
import {createMemoryHistory as createHistory} from 'history'
import Router from './Router'

/**
Expand Down
6 changes: 5 additions & 1 deletion packages/react-router/modules/StaticRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import warning from 'warning'
import invariant from 'invariant'
import React from 'react'
import PropTypes from 'prop-types'
import { addLeadingSlash, createPath, parsePath } from 'history/PathUtils'
import { createPath, parsePath } from 'history'
import Router from './Router'

const normalizeLocation = (object) => {
Expand All @@ -15,6 +15,10 @@ const normalizeLocation = (object) => {
}
}

const addLeadingSlash = (path) => {
return path.charAt(0) === '/' ? path : '/' + path;
}

const addBasename = (basename, location) => {
if (!basename)
return location
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router/modules/__tests__/Route-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import ReactDOM from 'react-dom'
import createMemoryHistory from 'history/createMemoryHistory'
import {createMemoryHistory} from 'history'
import MemoryRouter from '../MemoryRouter'
import Router from '../Router'
import Route from '../Route'
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router/modules/__tests__/Router-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import ReactDOM from 'react-dom'
import PropTypes from 'prop-types'
import Router from '../Router'
import createHistory from 'history/createMemoryHistory'
import {createMemoryHistory as createHistory} from 'history'

describe('A <Router>', () => {
const node = document.createElement('div')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import ReactDOM from 'react-dom'
import createHistory from 'history/createMemoryHistory'
import {createMemoryHistory as createHistory } from 'history'
import Router from '../Router'
import Switch from '../Switch'
import Route from '../Route'
Expand Down