Giter Club home page Giter Club logo

Comments (7)

xcarpentier avatar xcarpentier commented on May 11, 2024 3

Maybe a thing you need to know:
if your zones are embedded into a stack view for react-navigation and maybe be visible after a transition; if the start() occurs before the transition that may not work as expected. To fix it you have to wait until transition end.
You can do it using the react-navigation listener:

const {  addListener } = useNavigation();
const [transitionEnd, setTransitionEnd] = useState(false);
useEffect(() => {
    const unsubscribe = addListener('transitionEnd', () => {
      setTransitionEnd(true);
    });

    return () => {
      if (unsubscribe) {
        unsubscribe();
      }
    };
}, []);
useEffect(() => {
  if(canStart && transitionEnd) {
    start()
  }
}, [canStart, transitionEnd])

from rn-tourguide.

mzupek avatar mzupek commented on May 11, 2024 1

sounds good, I will provide a code example on a snack with react-navigation.

from rn-tourguide.

mzupek avatar mzupek commented on May 11, 2024 1

I appreciate your feedback and guidance, I will post my findings. I am still am putting together a simple implementation with react native navigation as a test, I will add complexity from there.

from rn-tourguide.

mzupek avatar mzupek commented on May 11, 2024

Also, am I able to run more than one tour, I am looking to have one per RN nav screen in my app... I tried setting this up to no avail... or a way to create them dynamically

from rn-tourguide.

xcarpentier avatar xcarpentier commented on May 11, 2024

Hi @mzupek,

I think I understand a bit about what is the problem as you described the zones in simple UI works fine but when going to something more complex we don't yet have a good solution yet.

BTW it will be a good starting point if you provide a code example on a snack (with react-navigation).

from rn-tourguide.

mzupek avatar mzupek commented on May 11, 2024

thanks for that info that will be helpful for sure, as I am sure that is occurring.

I have some thoughts, would just love some feedback from your perspective?

The functionality that I am really looking to implement is a tour for each module in my app, most modules have a series of "react-navigation screens", I would like the main screen component of the module to be wrapped in its own <TourGuideProvider> rather than it being on the root... so I can have the tour be on a toggle on each of those main screens, giving new users an intro to using the app on their first run-through and be disabled after, also providing a menu of available tours, that will navigate them to the main screen of that specific module and start that tour.

That's my eventual end goal...lol... any thoughts/ideas are much appreciated.

from rn-tourguide.

xcarpentier avatar xcarpentier commented on May 11, 2024

I don’t see any issue to have multiple tour guide instead of one at the root if you are sure there isn’t nested tour guide provider.

But think about it, with only one provider at root you gain less code.

And even if some are the same zone number that will not cause issue if views with tour guide are not one over another. Actually the calculation is acted when render.

from rn-tourguide.

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.