nandorojo / solito

🧍‍♂️ React Native + Next.js, unified.
https://solito.dev
MIT License
3.54k stars 181 forks source link

Navigation error when the route has different params id #341

Closed jeisux92 closed 1 year ago

jeisux92 commented 1 year ago

Hi Fernando, i was playing around with the framework but i got a problem when navigating to a route and the params change. for instance: home=>form/2=>general=>form/4(this page gets override and when using back is going straight to home)

this is happening in react native and they fixed it by using a key option on the navigation. Navigate with something like this

this.props.navigation.navigate({
        routeName: 'form',
        params: { 
            id: form.id,
        },
        key: 'form' + form.id
    });

below a I leave a link with the reference https://github.com/react-navigation/react-navigation/issues/2882

nandorojo commented 1 year ago

does adding getId on your stack screen help?

jeisux92 commented 1 year ago

yes @nandorojo , thank you so much!