Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Use named import of 'history' module to fix remix-run#5576. (remix-ru…
Browse files Browse the repository at this point in the history
…n#5589)

* Use named import of 'history' module.

* Coding style fixes.
  • Loading branch information
RoboBurned authored and jeresig committed Aug 29, 2018
1 parent bbcd472 commit 7dc1264
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 7 deletions.
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

0 comments on commit 7dc1264

Please sign in to comment.