Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does this doesn't work with latest version of react or react-router-dom ? #31

Closed
primeTanM opened this issue Oct 9, 2022 · 5 comments
Closed

Comments

@primeTanM
Copy link

Does this doesn't work with latest version of react or react-router-dom after doing this:

const AnimatedRoutes = () => {
  const location = useLocation();
  return (
    <PageTransition
      preset="moveToLeftFromRight"
      transitionKey={location.pathname}
    >
      <Routes location={location} key={location.pathname}>
        <Route exact path="/" element={<Home />} />
        <Route exact path="/about" element={<About />} />
        <Route exact path="/projects" element={<Projects />} />
        <Route exact path="/blogs" element={<Blog />} />
        <Route exact path="/contact" element={<Connect />} />
      </Routes>
    </PageTransition>
  );
};

it doesn't render anything?

@nkomp18
Copy link

nkomp18 commented Nov 8, 2022

It seems to be broken for latest version of react.
Error is:
A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.

@stetttho
Copy link

stetttho commented Jan 5, 2023

bump - anyone got this working? also tried framer-motion, but basic slideIn (see https://codesandbox.io/s/advanced-react-page-transition-demo-z8hmd , preset “moveToLeftFromRight”) doesn’t seem to be possible with it?

@LibanWasTaken
Copy link

bump#2 still don't know how to use it with routes and stuff, although wrapping the Route with Routes seems to resolve the error, but nothing except the navbar renders

@c0ncentus
Copy link

nowadays "exact" is deprecated and "render" seems also depracated ...
need some works around to put version up to date ...

@Steveeeie
Copy link
Owner

See: #33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants