Giter Club home page Giter Club logo

Comments (9)

kanzitelli avatar kanzitelli commented on July 23, 2024

Hi @Yasir5247! That's not easy as with RNN, unfortunately, and you will need to have something like explained here -- https://reactnavigation.org/docs/hiding-tabbar-in-screens/. As of now with current starter's nav setup, it's doable but will need some more code and changes to make. I will rewrite the setup a bit, so your use case would be handled easily. Thanks for creating the issue for that!

from expo-starter.

Yasir5247 avatar Yasir5247 commented on July 23, 2024

@kanzitelli any expected aprox date? i'm actually desperate. :)

from expo-starter.

kanzitelli avatar kanzitelli commented on July 23, 2024

@Yasir5247 hey! I am actually working since yesterday on a new navigation library for React Native which should work both with react-navigation and react-native-navigation and have almost the same api. But in the beginning it will only support react-navigation. So I will publish a branch with draft implementation soon and it would be great if you could help me to test it out. And approximate date will come faster ๐Ÿ˜„

from expo-starter.

Yasir5247 avatar Yasir5247 commented on July 23, 2024

yes. i'm in for testing. :)

from expo-starter.

kanzitelli avatar kanzitelli commented on July 23, 2024

Closing the issue as your use case can be achieved with [email protected] and [email protected]. If you could test it, that would be great!

from expo-starter.

Yasir5247 avatar Yasir5247 commented on July 23, 2024

@kanzitelli looks great so far. however "passing props to stack and tabs navigators" is very important i guess.
also first screen of the stack doesn't have default header. in this case i have handle the back button etc explicitly i guess.

from expo-starter.

kanzitelli avatar kanzitelli commented on July 23, 2024

hi @Yasir5247! thanks for the feedback!

yes, iโ€™m planning to add props for navigators in the next releases. however there were some unclear moments for me, ill see how to solve that.

and yes, back button only is being shown on android when you show stack over tabs. but it doesnโ€™t happen on iOS (in face it happens but on a higher level navigator). because when i tried to do the same with pure React Navigation, iโ€™ve had the same behaviour. if you could achieve showing back button on the pushed stack, let me know

from expo-starter.

Yasir5247 avatar Yasir5247 commented on July 23, 2024

@kanzitelli

import { Navio } from "rn-navio";

export const navio = Navio.build({
  screens: {
    HomeScreen: {...},
    ProductDetailScreen: {...},
    ProductDescScreen: {...},
  },
  stacks: {
    ProductStack: [
      'ProductDetailScreen',
      'ProductDescScreen',
    ],
    HomeStack: [
      'HomeScreen',
    ],
  },
  tabs: {
    HomeTab: {
      stack: 'HomeStack',
      options: {...},
    },
    ExploreTab: {
      stack: 'ExploreStack',
      options: {...},
    },
  },
  root: 'Tabs',
  hooks: [useAppearance],
  options: {
    stack: screenDefaultOptions,
    tab: tabDefaultOptions,
  },
})

imagine having this structure. on the home screen i click a product and go to product stack and show "product detail screen". on the "product detail screen" when i want to go back to the tab, right now i just do

//ProductDetailScreen.tsx
// UI Methods
const configureUI = () => {
    navigation.setOptions({
      headerLeft: () => <BButton onPress={()=> navio.popToTop()} />,
      headerRight: () => <BButton onPress={()=> {
        if(AuthUser.User.isLogin) {
          productViolationModalRef.current.open()
        }
      }}/>,
    });
 };

I'm not sure if this is the right way, since i'm new to react navigation. however it works. but the back button does't feel like the default back button though. and creating this back button manually on each stack would be kinda pain i guess if the app is big. and android doesn't work in this case ๐Ÿ˜€

Screenshot 2022-10-08 at 02 50 37

from expo-starter.

kanzitelli avatar kanzitelli commented on July 23, 2024

@Yasir5247 yeah, unfortunately, with rn-navio itโ€™s not possible to have back button when pushing another stack. iโ€™m not sure if you can achieve it with react-navigation tho, bc rn-navio is built on top of it and follows their advice for hiding tabs. i will check it more, maybe there might be a hack

from expo-starter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.