torgeadelin / react-native-animated-nav-tab-bar

A simple and customisable React Native component that implements an animated bottom tab bar for React Navigation.
MIT License
889 stars 102 forks source link

Broken animation when using navigation.dispatch(CommonActions) #92

Closed namachan0219 closed 2 years ago

namachan0219 commented 3 years ago

Hello!

The problem occurs during the screen transition between the Stack Screens nested in the Bottom Navigator. The bottom navigation animation stops at the screen before the transition. The screen transition has been executed correctly and we are now on a new screen, but the bottom navigation is where it was before the screen transition. The code below illustrates this. After the screen transition, we are at the specified ScreenA, and The bottom navigation remains at routeStack02. If we use goBack() on ScreenA, we will return to routeStack01. I believe that the navigation is executed correctly.

"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "~0.63.4",
"react-native-animated-nav-tab-bar": "^3.1.4",
// bottom Navigation
<Tabs.Navigator>
    <Tabs.Screen
        name="Stack01"
        comonent={Stack01}
    />
    <Tabs.Screen
        name="Stack02"
        comonent={Stack02}
    />
</Tabs.Navigator>   
// Stack01
<Stack.Navigator>
    <Stack.Screen
        name="routeStack01"
        comonent={routeStack01}
    />
    <Stack.Screen
        name="ScreenA"
        comonent={ScreenA}
    />
</Stack.Navigator>

// Stack02
<Stack.Navigator>
    <Stack.Screen
        name="routeStack02"
        comonent={routeStack02}
    />
</Stack.Navigator>  
// navigation in routeStack02
<View>
    <Button onPress={() => {
    navigation.dispatch(
        CommonActions.reset({
            index: 1,
            routes: [
                { name: "Stack01" },
                { name: "ScreenA" }
            ]
        })
    );
    navigation.dispatch(
        CommonActions.navigate({
            name: 'ScreenA'
        })
    );
    }}>CommonActions</Button>
</View>
github-actions[bot] commented 2 years ago

Stale issue message

hlarrainq commented 8 months ago

Hey!

I have this same bug. Do you know any workaround to fix this?