React-native-router-flux: REPLACE does not replace the proper route

Created on 9 Jan 2019  路  3Comments  路  Source: aksonov/react-native-router-flux

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.6
  • react v16.2.0
  • react-native v0.53.3

Expected behaviour

REPLACE does not work properly, it replaces wrong route.

Actual behaviour

REPLACE to replace the proper route.

I think that this code is problematic here:
const routes = [...parent.routes.slice(0, index - 1), ...parent.routes.slice(index)];

Shouldn't it be this?
const routes = [...parent.routes.slice(0, index), ...parent.routes.slice(index + 1)];

Most helpful comment

Same here, tested today and indeed, the parent is popped and replaced by the scene given in parameter

All 3 comments

+1 Encountering the same issue

Same here, tested today and indeed, the parent is popped and replaced by the scene given in parameter

+1 same issue on v4.0.6

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rafaelcorreiapoli picture rafaelcorreiapoli  路  3Comments

GCour picture GCour  路  3Comments

jgibbons picture jgibbons  路  3Comments

xnog picture xnog  路  3Comments

moaxaca picture moaxaca  路  3Comments