ionic-team / ionic-team/ionic-framework

bug: Ionic React allows navigation to exact same page

Open
#20,830 1 comment 0 reactions 0 assignees View on GitHub
package: react type: bug
Dominant language
TypeScript
Stars
52.7k
Forks
13.3k
Avg merge
1d 15h
Merged PRs (30d)
51

Description

# Bug Report

**Ionic version:**

[x] **5.x**

**Current behavior:**

When on page `/foo` and trying to navigate to page `/foo` again, Ionic React will perform a nav transition to take you to `/foo`.

**Expected behavior:**

The current behavior is not consistent with what happens in Ionic Angular. Attempting to navigate from `/foo` to `/foo` should _not_ perform any nav transition as it is trying to navigate to the exact same page.

**Steps to reproduce:**

Download the repo: https://github.com/liamdebeasi/ionic-react-same-page-bug

1. Run the app in the `react` directory.
2. Click the `ion-button`. You should be navigated from `/home` to `/home` again.
3. Run the app in the `angular` directory.
4. Click the `ion-button`. You should _not_ be navigated from `/home` to `/home` again.

> In the case of `/pageone/:id` routing, I _would_ expect Ionic React to navigate to the same page as long as `:id` was different. For example, I would expect `/pageone/1` --> `/pageone/2` to work, but I would not expect `/pageone/1` --> `/pageone/1` to work.

**Ionic info:**

```
Ionic:

Ionic CLI : 6.2.2 (/Users/liamdebeasi/.nvm/versions/node/v10.15.0/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/react 5.0.5

Capacitor:

Capacitor CLI : 1.5.1
@capacitor/core : 1.5.1

Utility:

cordova-res (update available: 0.10.0) : 0.6.0
native-run (update available: 0.3.0) : 0.2.7

System:

NodeJS : v10.15.0 (/Users/liamdebeasi/.nvm/versions/node/v10.15.0/bin/node)
npm : 6.9.2
OS : macOS Catalina
```

Contributor guide

Open the contributing guide

Research direction

Start with the linked ionic-react-same-page-bug repository and run the app in its react directory to reproduce navigation from /home to /home. Compare its behavior with the angular directory and trace the Ionic React navigation entry point. Done means an exact same-page navigation has no transition, while routes such as /pageone/1 to /pageone/2 still navigate.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, react, typescript
Domain
frontend, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.