Skip to content
This repository has been archived by the owner on Oct 27, 2021. It is now read-only.

Multiple render of cards when route is replaced #23

Closed
georgberecz opened this issue Jun 5, 2017 · 3 comments
Closed

Multiple render of cards when route is replaced #23

georgberecz opened this issue Jun 5, 2017 · 3 comments
Assignees
Labels

Comments

@georgberecz
Copy link

georgberecz commented Jun 5, 2017

Hey guys,
I checked out your package and came across some problems on iOS and Android. It seems that cards are rendered multiple times by the CardStack even though they should only be rendered once when I replace the current history.
I dispatch a replace from react-router-redux in an action creator that reroutes to my index Card like this:

export function setStoryActive(userId, storyId) {
  return (dispatch) => {
    dispatch(setStoryActiveStart());
    return postActiveStory(userId, storyId)
      .then(json => {
        dispatch(setStoryActiveSuccess(json));
        dispatch(getStoryProgress(userId, storyId))
        dispatch(replace('/'));
      }).catch((e) => {
        console.error(e);
        dispatch(setStoryActiveError(e.message));
      })
  };
}

In general, the redirect and replace works. However, it seems that despite the replace the old card is still rendered below the new replaced one:
image
As can be seen that leads to the overlapped text in the middle and the rendering of the back button (which should not be present and which actually cannot be clicked, because it lays beneath).

I'm using a setup with

    "react-router": "^4.1.1",
    "react-router-native": "^4.1.1",
    "react-router-navigation": "^1.0.0-rc.0",
    "react-router-redux": "^5.0.0-alpha.6",

I would really appreciate fast help with that problem. :)

Btw, I love your package! Saw the great lightning talk from @CharlesMangwa at ReactConf and really like the way you guys handle the navigation! 👍

@georgberecz
Copy link
Author

Apparently, while I was writing the issue somebody else came across the exact same problem: #22

@LeoLeBras LeoLeBras self-assigned this Jun 5, 2017
@LeoLeBras LeoLeBras added this to the 1.0.0-rc milestone Jun 5, 2017
@LeoLeBras
Copy link
Member

LeoLeBras commented Jun 5, 2017

rc release isn't published yet because there are some bugs to fix. I'm a little bit busy at the moment, but it’s scheduled for next week with this issue fixed.

@LeoLeBras
Copy link
Member

This should be fixed in 1.0.0-rc.2

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

No branches or pull requests

2 participants