Giter Club home page Giter Club logo

Comments (5)

eriklharper avatar eriklharper commented on July 17, 2024 1

The pathname: '/wp' param did the trick, thank you for that! After getting that /wp portion solved, I ran into the same exact problem right away though, where routes that I defined under next properties of top-level routes were not coming through in the route object.

But after looking at your "Base Location" example on this line I realized that I needed to explicitly pass the route.next junction as well as the locate function to my child components from my AppScreen component.

Once I figured that out, everything magically worked!

from navi.

jamesknelson avatar jamesknelson commented on July 17, 2024

I think what is happening is that your switch statement is switching over the wp route instead of the inner route. You can confirm this by printing the route to screen.

That said, if your application lives underneath a subdirectory, it is probably best to use the baseLocation path feature of the Converter class.

To do this, change the createConverter call to:

createConverter(AppScreen.junction, { pathname: '/wp' })

You'd also want to remove the wp junction and just use the inner junction that you have.

Let me know if this works!

from navi.

eriklharper avatar eriklharper commented on July 17, 2024

Another thing I'm noticing is that a full page reload occurs when I click between links to go to different locations that I'm using the <Link> component from react-junctions to produce. Anyway to prevent that?

from navi.

jamesknelson avatar jamesknelson commented on July 17, 2024

You may need to pass a history to your <Link> components, either with props, or with a HistoryContext.

from navi.

eriklharper avatar eriklharper commented on July 17, 2024

👍 That was it! Thanks! Good to see how these pieces fit together outside of using components that pass this all down with React context.

from navi.

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.