rdkcentral / Lightning-SDK

SDK for Lightning framework
Apache License 2.0
130 stars 69 forks source link

Router reuses a component instance even if the corresponding option is disabled #269

Closed Serhii-the-Dev closed 2 years ago

Serhii-the-Dev commented 3 years ago

Given such a Router config:

export default {
  root: 'app/catalog/home',
  routes: [
    {
      path: 'app/video/:videoId',
      component: Video,
      options: {
        reuseInstance: false,
      },
    },
    {
      path: 'app/:entityType/:entityId',
      component: Page,
      options: {
        reuseInstance: false,
      },
    },
  ],
}

and the next navigation chain setup: Page -> Page -> Video, the forward navigation works just fine, however while moving backwards a first encountered Page will be reused. It makes impossible to rely on any component lifecycle hooks (like _active) or use animated transitions between screens.

michielvandergeest commented 2 years ago

We have tried this recently but were not able to reproduce the issue anymore.

I'm closing this issue, but feel to re-open if this is still an issue with the latest version of the SDK, preferably with a test project that showcases the issue.