21 Commits

Author SHA1 Message Date
a78f6b3151 feat(IonRouter): migrate to functional component with react router 6
Co-authored-by: Sean Perkins <13732623+sean-perkins@users.noreply.github.com>
2025-06-09 13:07:24 -07:00
a17b963182 fix(react): replacing route uses new route direction and animation (#28671)
Issue number: resolves #24260

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?

When replacing a route (`router.push(newRoute, 'none', 'replace')`) the
`RouterDirection` from the route being replaced is being used (if it
exists) instead of the new one the user specifies.

## What is the new behavior?

User-specified `RouteDirection` is used, if it exists. If it doesn't it
falls back to the `RouteDirection` of the route being replaced.

## Does this introduce a breaking change?

- [ ] Yes
- [X] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

Please see the following comment for why I think the current behavior is
incorrect, and why this change is needed:
https://github.com/ionic-team/ionic-framework/issues/24260#issuecomment-1078960780

---------

Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
2023-12-11 21:09:41 +00:00
fc88613fef fix(react): use custom animation when going back after a replace (#28674)
Issue number: resolves #28673

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

When reviewing https://github.com/ionic-team/ionic-framework/pull/28671
I noticed a bug where the custom animation was not used when going back
after a replace.

`handleNavigate` will override whatever is in `incomingRouteParams`.
Since we were passing `routeAnimation` (which is `undefined`), it was
overriding the animation we set in `handleNavigateBack`.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- `routeAnimation` is no longer overridden

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

Dev build: `7.6.1-dev.11702048520.13c82dad`
2023-12-11 17:31:27 +00:00
824033f1d4 fix(react, vue): custom animations are used when going back (#27895)
Issue number: resolves #27873

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

Custom animations are not always used when the `handleNavigateBack`
method is called. This impacts both Ionic React and Ionic Vue.

While we do set the `incomingRouteParams` with the animation:
a08a5894ba/packages/react-router/src/ReactRouter/IonRouter.tsx (L247-L252)

We do sometimes call `handleNavigate`:
a08a5894ba/packages/react-router/src/ReactRouter/IonRouter.tsx (L273-L279)

This `handleNavigate` method sets `incomingRouteParams` again:
a08a5894ba/packages/react-router/src/ReactRouter/IonRouter.tsx (L225-L230)

Since we do not re-pass `routeAnimation`, that field gets set to
`undefined` and the custom animation does not get used.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Custom animation is now passed to `handleNavigate`

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

Dev build: `7.2.2-dev.11690810887.180000d1`
2023-07-31 17:57:03 +00:00
6d4c52aa5b chore(react-router): migrate to eslint, add prettier (#26634) 2023-01-18 17:22:16 -05:00
e3ef932ae1 chore(many): add tech debt tickets and remove unnecessary todos (#26266) 2022-11-14 14:49:08 -06:00
36bfa33503 fix(react): remove @ionic/core dependency in @ionic/react-router to resolve yarn install warning (#23351)
resolves #23346
2021-05-24 10:32:33 -04:00
4da5216b4f fix(react): support history@5 in preparation for react router 6 (#23297)
resolves #23294
2021-05-14 09:03:15 -04:00
7203190234 fix(react, vue): correct view now chosen when going back inside tabs (#23154)
resolves #23087
resolves #23101
2021-04-06 10:16:23 -04:00
943e3f6ae3 fix(react, vue): tab buttons no longer throw an error if href is undefined (#22998)
resolves #22997
2021-03-02 10:05:59 -05:00
cd8ffd82a0 fix(react, vue): navigating using ion-back-button now selects correct page (#22974)
resolves #22830
2021-02-25 13:18:20 -05:00
9e9a372497 fix(react, vue): do not show back button when replacing to root page (#22750)
resolves #22528
2021-01-13 10:10:44 -05:00
f891f66708 fix(react): improve view matching logic (#22569) 2020-12-15 11:03:08 -05:00
91aaaab71a chore(react): adding prettier and formating files 2020-12-07 09:31:33 -07:00
36939e10ae fix(react): android hardware button should invoke browser back 2020-12-07 08:33:00 -07:00
74af3cb50b fix(react): Keep a hold of previous routes when doing a redirect, closes #22053 2020-09-08 19:58:00 -06:00
4090250da7 chore(react): fixing lint errors 2020-09-08 09:36:44 -06:00
b11e06cec1 fix(react): redirect routes should unmount leaving component, fixes #22022 (#22029) 2020-09-04 14:56:20 -06:00
a15cd01bc3 fix(react): fixes swipe to go back regression (#21791) 2020-07-21 22:30:44 -06:00
81ef3f1ecd fix(react): fix regression with history.replace in new react router (#21698) 2020-07-08 10:22:08 -06:00
c171ccbd37 feat(react): React Router Enhancements (#21693) 2020-07-07 12:02:05 -05:00