coatue-oss / angular2react

One line of code to turn any Angular 1 Component into a React Component
Other
131 stars 25 forks source link

Page refreshes when routing to an AngularJS component #51

Closed raubel closed 9 months ago

raubel commented 9 months ago

Hi,

I am about to migrate a huge app from AngularJS to React and want to use this wonderful tool to help me to do it in an iterative way.

Using React Router v6 and a BrowserRouter (to have a client side routing and not a server side routing), each time the route leads to a component tree containing at least an AngularJS component ('reactified' using angular2react), the browser navigates to the URL: I have a page refresh instead of a client side routing. If my route leads to a component tree only composed by React components, client side routing works as expected.

Note that I have the same behavior with TanStack Router, so I guess this is not a router issue.

Does anyboby knows why this happens? Is it an AngularJS effect or a angular2react issue? Is there a workaround? Any help very appreciated!

raubel commented 9 months ago

I found the problem. I still had the Angular Router (ui-router) registered. It was the culprit refreshing my page. Closing the issue.