-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
7 changed files
with
59 additions
and
39 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
packages/react-router/src/ReactRouter/IonReactHashRouter.tsx
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,16 @@ | ||
import React from 'react'; | ||
import { HashRouter, HashRouterProps } from 'react-router-dom'; | ||
|
||
import { RouteManagerWithRouter } from './Router'; | ||
|
||
export const IonReactHashRouter = /*@__PURE__*/ (() => class IonReactHashRouterInternal extends React.Component<HashRouterProps> { | ||
render() { | ||
console.log('hash router in your bundle!!!'); | ||
const { children, ...props } = this.props; | ||
return ( | ||
<HashRouter {...props}> | ||
<RouteManagerWithRouter>{children}</RouteManagerWithRouter> | ||
</HashRouter> | ||
); | ||
} | ||
})(); |
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,15 @@ | ||
import React from 'react'; | ||
import { BrowserRouter, BrowserRouterProps } from 'react-router-dom'; | ||
|
||
import { RouteManagerWithRouter } from './Router'; | ||
|
||
export const IonReactRouter = /*@__PURE__*/ (() => class IonReactRouterInternal extends React.Component<BrowserRouterProps> { | ||
render() { | ||
const { children, ...props } = this.props; | ||
return ( | ||
<BrowserRouter {...props}> | ||
<RouteManagerWithRouter>{children}</RouteManagerWithRouter> | ||
</BrowserRouter> | ||
); | ||
} | ||
})(); |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
|
||
export { IonReactRouter } from './Router'; | ||
export { IonReactRouter } from './IonReactRouter'; | ||
export { IonReactHashRouter } from './IonReactHashRouter'; |
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