ReactJS page transitions while changing the address in the nav bar - reactjs

Hi can anyone point me to a working solution for having page transitions with React while also changing the address in the nav bar. Any solution I have found that is more than 6 months old no longer works with the latest version of React (18.2.0). I have also downgraded to use react-router-dom v5 and older versions of react-router. I have tried react-spring, headlessUI and also TransitionGroup Nothing works.
I just need a clean, fresh example of a Home page transitioning into an About us page by clicking the About us button and you see the home page fade out or slide to the left as the About us page fades in or slides in from the right and during the transition you momentarily see both pages at the same time. In the address bar it needs to change from "/" or "/home" to "/about-us".
That's all.
Anyone?

Related

React navigation and routing problem with a multipage application

I have a react project with multiple pages however if i scroll in one page and then use the navigation bar to navigate to another page the scroll is not undone so the page starts at the position of the previous scroll
Please refer to this question:
react-router scroll to top on every transition
They asked the same question.

How to transition into specific part of the page usings its id with gatsby-plugin-transition-link plugin

My website has a navbar with where most of the links scrolls you to a section in the home page.
I want to use gatsby page transition from another page and scroll into that particular section of the home page.
Something like this
<AniLink fade to="/#about-us">
About Us
</AniLink>
I dont find any information about this in the official docs. How would I implement this feature.
I would use Gatsby page transitions on the links to other pages and for the links to anchors on the same page use the smooth-scroll npm package: https://www.npmjs.com/package/smooth-scroll
Here is a medium post on how to set it up with Gatsby also: https://medium.com/#chrisfitkin/how-to-smooth-scroll-links-in-gatsby-3dc445299558
Alternatively, there are some Gatsby plugin options too including this one which looks nice: https://www.gatsbyjs.org/packages/gatsby-plugin-smoothscroll
AniLink is used for "Page transition". In your case, you need "scroll" transition. In other words, you just need smooth scrolling.
You can try react-scroll to achieve that.

How to show sidebar router page in Tab

I am using DevExtreme react template in my react js project from below link.The router page navigation is working fine as per my requirement.I would like to know how to use router page navigation as in "Tab" instead of single page.For example if we take from below link,there are two pages in sidebar (profile and display data pages).If I click "Profile and display page" ,both the pages should display in Tab but currently its shows only current page.hope its clear.
https://devexpress.github.io/devextreme-react-template/#/home
I also want to note that you can contact DevExpress support team directly at Submit a Support Ticket. They answer questions in 24 hours, so you will be able to resolve the issue faster.

React routing and back button reloading

I'm using React with react-router v4 for routing in a SPA app.
From within a list page, when user taps on an item, we navigate to detail url which renders detail component.
From here, if I click back, route transitions to list page but list page itself is reloaded. So its scroll position, selection of an item (which opened the details page) is lost.
I have been struggling to think about how to approach this problem. One way I was thinking is to build all pages to open as model on top of another so base page context is always there and when user navigates back, I can start to close the modals revealing previous page in its exact state.
Not sure if that is a right approach.
You could store the current scroll position locally, then scroll back to it when your list page component is mounted.
These are jQuery answers, but the principle is the same:
Restoring page scroll position with jQuery
How can I retain the scroll position of a scrollable area when pressing back button?

Ionic framework UI router bug in Drawer side menu content?

I've been coding an Ionic application using Intel XDK and I'm experiencing a weird issue using the Ionic framework. I am using nested states inside the side content of my drawer template and found a weird behaviour with the latest version of Ionic (1.2.4) which is pulled using Bower.
With the latest version I was getting a weird behaviour where when transition from state 1 to state 2 would look something like this: weird bug
Also when in State 2 the side content would no longer be able to swipe the side drawer open as it did in the previous state.
This is a link to the plunker were it uses the old 1.0.0 beta version of ionic http://embed.plnkr.co/mX9DJRYMfTNHz0bYyMgw/
The state transitions correctly and the second state still allows for the drawer to be swiped open. I obviously don't want to use an older version of ionic because it doesn't support fancy things like pop overs that I would like use in the app.
Thanks,
I was able to solve the problem, For the new version of ionic every state transition is cached. When the state transition occurs the side drawer is left open. This is why in the emulator you see the a weird layer lingering but don't see it on the phone. To close the drawer you must use the menu-close directive. I inserted it inside
<a menu-close ui-sref ="state2">
The menu-close directive will reset the entering view’s
history stack, making the new page the root of the history stack.

Resources