Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renderOverlay receives wrong scene after replace #73

Open
dbasedow opened this issue May 4, 2016 · 0 comments
Open

renderOverlay receives wrong scene after replace #73

dbasedow opened this issue May 4, 2016 · 0 comments

Comments

@dbasedow
Copy link

dbasedow commented May 4, 2016

When using a custom reducer to replace the current navigation state (using NavigationStateUtils.replaceAt) the renderOverlay function receives the wrong scene. This is because a new scene was created in the scene reducer and the previous one set to isStale=true. renderOverlay gets scenes[navigationState.index] as the scene prop.

Fixing it would be quite easy:

const key = 'scene_' + navigationState.children[navigationState.index].key;
const sceneIndex = scenes.findIndex(s => s.key == key);
...
scene: scenes[sceneIndex]

But I don't think having this stale scene around is right in this case. For me it's not that big of an issue, because I realized I don't really need the scene in renderOverlay, but keeping a stale scene around that is not involved in any animations seems a bit wasteful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant