Skip to content

feat(react): Allow to use HashRouter in IonReactRouter component#19672

Closed
iagobruno wants to merge 2 commits into
ionic-team:masterfrom
iagobruno:master
Closed

feat(react): Allow to use HashRouter in IonReactRouter component#19672
iagobruno wants to merge 2 commits into
ionic-team:masterfrom
iagobruno:master

Conversation

@iagobruno

@iagobruno iagobruno commented Oct 15, 2019

Copy link
Copy Markdown

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

By default the IonReactRouter uses the BrowserRouter component under the hood to route paths, but this can create some problems as described in this issue #19621.

What is the new behavior?

This pull request adds a prop that lets you use HashRouter instead of BrowserRouter.

const App: React.FC = () => (
  <IonApp>
    <IonReactRouter useHashRouter={true}>
      // ...
    </IonReactRouter>
  </IonApp>
);

Does this introduce a breaking change?

  • Yes
  • No

Other information

What do you think of the name "useHashRouter"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant