Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure app to work with react HashRouter #4284

Merged
merged 2 commits into from
Jul 12, 2018

Conversation

Hyperkid123
Copy link
Contributor

@Hyperkid123 Hyperkid123 commented Jul 12, 2018

Angular $locationProvider is listening on URL fragment change and with default settings it enfoces ! as a hash prefix. This was causing conflict with react-router when its using hashHistory. Both are trying to add their own prefix (angular !#, react #) and that was causing infinite loop.

By removing angular default prefix, this conflict was resolved. Note that react hashHistory (repo: https://github.com/ReactTraining/history) can be configured with hashbang prefix and we can add it if need be, but both $locationProvider and ReactRouter must have the same prefix in order to work alongside each other.

because we are currently not using any angular client-side routing, no existing angular components should be affected.

@Hyperkid123
Copy link
Contributor Author

@miq-bot
Copy link
Member

miq-bot commented Jul 12, 2018

Checked commits Hyperkid123/manageiq-ui-classic@aa14e54~...08e3ee9 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
0 files checked, 0 offenses detected
Everything looks fine. 👍

Copy link
Contributor

@karelhala karelhala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codewise looks good, simple and clean solution.

@karelhala
Copy link
Contributor

@miq-bot assign @himdel

@himdel
Copy link
Contributor

himdel commented Jul 12, 2018

Looks like GTLs and toolbars are still behaving correctly, LGTM :)

@himdel himdel merged commit 896ba38 into ManageIQ:master Jul 12, 2018
@himdel himdel added this to the Sprint 90 Ending Jul 16, 2018 milestone Jul 12, 2018
@Hyperkid123 Hyperkid123 deleted the router-debug branch July 12, 2018 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants