GithubHelp home page GithubHelp logo

Comments (5)

maisano avatar maisano commented on June 8, 2024

in order to address this issue, i think i need some more information. i've done my best to enumerate some questions that would hopefully give me enough information to help:

  1. why are you re-routing in the componentWillMount of <App />?
  2. what do your route declarations look like?
  3. what does the render body of <App /> look like?

from react-router-transition.

beckend avatar beckend commented on June 8, 2024

The route match for app is:

<Route path='/app*' component={ require('./components/app/app') }>

I have an Iframe inside app, so I change the URL to reflect the iFrame sub pages:
http://app.dev/page/sub-page.

So if you login into the application from route /login, you are redirected to /app.
App async loads iFrame, when it's loaded, the URL is updated to reflect what page the iFrame is on.

This is done because the user can visit the site with path such as `/app/page/my-page'.

I noticed that react-router-transition will try to transition when I do these URL manipulations and causing the issue. The thing is I never leave my route, since it's /app*.

from react-router-transition.

maisano avatar maisano commented on June 8, 2024

thanks for the details.

the pathname prop of RouteTransition is essentially a key mapping to the matched route. i hadn't considered fuzzy paths when designing it. the problem is that RouteTransition thinks you're trying to render a wholly different component and will apply the transition accordingly. as a fix in the interim, it should be easy enough to not use the fully-qualified path in this instance, and to just pass in '/app' for the pathname when you're within the app tree.

from react-router-transition.

beckend avatar beckend commented on June 8, 2024

I see, i did a monkey patch, passing a monkey function to location prop worked nicely.

from react-router-transition.

maisano avatar maisano commented on June 8, 2024

awesome. if you have any ideas/opinions on how this should be handled within RouteTransition, feel free to open a pr :)

from react-router-transition.

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.