Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add components:
HashRouter
BrowserRouter
MemoryRouter
.
- Loading branch information
Showing
24 changed files
with
263 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** vscode config */ | ||
{ | ||
|
||
"compilerOptions": { | ||
|
||
"target": "ES6", | ||
|
||
"module": "commonjs", | ||
|
||
"experimentalDecorators" : true, | ||
|
||
"lib": [ | ||
"es7", | ||
"es2017.sharedmemory", | ||
"es2017.object" | ||
] | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Router from './Router' | ||
import createBrowserHistory from 'history/createBrowserHistory' | ||
|
||
export default class BrowserRouter extends Router { | ||
} | ||
|
||
BrowserRouter.prototype.createHistory = function () { | ||
const { basename, hashType, getUserConfirmation } = this.props | ||
return createBrowserHistory({ basename, hashType, getUserConfirmation }) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Router from './Router' | ||
import createHashHistory from 'history/createHashHistory' | ||
|
||
export default class HashRouter extends Router { | ||
} | ||
|
||
HashRouter.prototype.createHistory = function () { | ||
const { basename, hashType, getUserConfirmation } = this.props | ||
return createHashHistory({ basename, hashType, getUserConfirmation }) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Router from './Router' | ||
import createMemoryHistory from 'history/createMemoryHistory' | ||
|
||
export default class MemoryRouter extends Router { | ||
} | ||
|
||
MemoryRouter.prototype.createHistory = function () { | ||
const { initialEntries, initialIndex, getUserConfirmation } = this.props | ||
return createMemoryHistory({ initialEntries, initialIndex, getUserConfirmation }) | ||
} |
Oops, something went wrong.