Repository URL to install this package:
|
Version:
6.0.0 ▾
|
/**
* @file what this does, is load an *in-memory* polyfill of `history` when
* on server, or in test
* @api https://www.npmjs.com/package/history
*/
let history
if (
typeof window !== 'object' ||
process.env.BUILD_FLAG_IS_SERVER === 'true' ||
process.env.NODE_ENV === 'test'
) {
// console.log('memoryHistory')
history = require('history/createMemoryHistory').default
} else {
// console.log('browserHistory')
history = require('history/createBrowserHistory').default
}
let created
const makeHistory = (props?: any) => {
if (created !== undefined) {
return created
}
created = history()
return created
}
export { makeHistory }
export default makeHistory