React-native-router-flux: view is not re-rendered when click button too fast

Created on 11 Dec 2016  路  10Comments  路  Source: aksonov/react-native-router-flux

Version

Tell us which versions you are using:

  • react-native-router-flux v3.30.0
  • react-native v15.3.2

Expected behaviour

I have two Scenes
<Scene key="myInfoView" component={MyInfoView} hideNavBar={true}/>
<Scene key="orderListView" component={OrderListView} hideNavBar={true}/>
in myInfoView there is several buttons to go to orderListView with different filter params.
So in the handler of the buttons I called Actions.orderListView({filter:<params>}) to go to the orderListView to show the different order lists, such as wait for paying orders, wait for delivery orders.

Actual behaviour

Normally it works fine, but i found there is a issue when i do the actions quickly.

Steps to reproduce

You can reproduce the action like below:

  1. go to orderListView with filter id 0.
  2. go back to myInfoView.
  3. quickly go to orderListView with filter id 1. ( if i wait for 1~2 seconds, everything is fine )
  4. orderListView still show with filter id 0.

I also did some research, like add some logs in render method of orderListView.
I found that if i reproduce the actions quickly, it does not render the view, may be it's because when i trigger the action the animation is not finished, right?

Most helpful comment

I also experienced this exact issue. Seem that if you set the animation duration manually this issue will not appear.

<Router duration={400} ...>

All 10 comments

I am experiencing this same issue right now and trying to find a solution.

I also experienced this exact issue. Seem that if you set the animation duration manually this issue will not appear.

<Router duration={400} ...>

Yes, I also using the similar solution to fix the issue, but I think it might be not the best solution, the duration may need to be set to the different values in different devices.

I think another solution is use redux to pass the value

@ltjsjyyy Actually, when setting the duration like @erikandersson described, the screens render perfectly, even on fast tap. No matter if set to 400 or 0. I didn't test it on Android yet, but on iOS it works as expected.

I'm experiencing the same issue but the duration tip doesn't work for me. At the end of the animation it does a very quick back and forth between the original scene and the new one. I tried with 400, 250, 100 and 0. Doesn't change anything

This bug has been about for quite a while. Here's another couple of issues describing the same problem:

+1 Experiencing exactly the same issue as the OP.
Only the NavBar title gets updated, content seems somewhat cached and stays the same. ComponentDidMount is not being called.

same issue

Same issue!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fgrs picture fgrs  路  3Comments

YouYII picture YouYII  路  3Comments

GCour picture GCour  路  3Comments

wootwoot1234 picture wootwoot1234  路  3Comments

sylvainbaronnet picture sylvainbaronnet  路  3Comments